Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: array_key_exists #33

Open
mirivhbv opened this issue Apr 19, 2015 · 8 comments
Open

Warning: array_key_exists #33

mirivhbv opened this issue Apr 19, 2015 · 8 comments

Comments

@mirivhbv
Copy link

Warning: array_key_exists() expects parameter 2 to be array, null given in Y:\home\maynewblog.w\www\src\shameerc\Textpress\Textpress.php on line 213

Warning: array_key_exists() expects parameter 2 to be array, null given in Y:\home\maynewblog.w\www\src\shameerc\Textpress\Textpress.php on line 564

Warning: array_key_exists() expects parameter 2 to be array, null given in Y:\home\maynewblog.w\www\src\shameerc\Textpress\Textpress.php on line 213

What to do?

@shameerc
Copy link
Owner

shameerc commented Jun 6, 2015

Hi, Apologize for being late to respond. Were you able to figure out this issue?

@mohanzeal
Copy link

I think this is the issue caused because of the wrongly formatted json meta data in the articles. Remove semicolon at the last key=> value pair in the json meta data. Or else make the slug parameter in the json meta data as mandatory.

@ptcmariano
Copy link

I found the same error, to solve, changed the way get section and meta
Textpress/Textpress.php on line 207
by:
$sections = explode( PHP_EOL . PHP_EOL, $content);
$meta = json_decode(array_shift($sections), true);
to:
$sections = explode( "}", $content);
$meta = json_decode(array_shift($sections)."}", true);

but maybe not is better solution ... anyone have another solution

@jpu4
Copy link

jpu4 commented Dec 17, 2019

I found the same error, to solve, changed the way get section and meta
Textpress/Textpress.php on line 207
by:
$sections = explode( PHP_EOL . PHP_EOL, $content);
$meta = json_decode(array_shift($sections), true);
to:
$sections = explode( "}", $content);
$meta = json_decode(array_shift($sections)."}", true);

but maybe not is better solution ... anyone have another solution

This solution worked for me. Code is a bit old and slim is now on v4 but it's working. I'll see how much trouble it is to upgrade it. @shameerc any plans to revive this project?

@shameerc
Copy link
Owner

shameerc commented Jan 10, 2020 via email

@jpu4
Copy link

jpu4 commented Jan 10, 2020 via email

@shameerc
Copy link
Owner

shameerc commented Jan 11, 2020 via email

@jpu4
Copy link

jpu4 commented Jan 11, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants