Serendipity icon indicating copy to clipboard operation
Serendipity copied to clipboard

Warning: Undefined array key "entries" in *

Open ttrueten opened this issue 3 years ago • 6 comments

Hello all, I hope I am right here for the error messages in Serendipity 2.4-beta1 and PHP 8.0.16 related to Bootstrap 4 template:


Warning: Attempt to read property "value" on null in /home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 27

Warning: Undefined array key "is_preview" in /home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 255

Warning: Attempt to read property "value" on null in /home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 255
/home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 257

Warning: Attempt to read property "value" on null in /home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 257
" title="
Warning: Undefined array key "footer_info" in /home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 258

Warning: Attempt to read property "value" on null in /home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 258
">
/home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 261

Warning: Attempt to read property "value" on null in /home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 261
disabled">
/home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 262

Warning: Attempt to read property "value" on null in /home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 262
"> «vorherige Seite
/home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 269

Warning: Attempt to read property "value" on null in /home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 269
disabled">
/home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 270

Warning: Attempt to read property "value" on null in /home/www/templates_c/bootstrap4/e4/f2/eb/e4f2eb6ce8e02d14ebdd52bd9b61557faf235c48_0.file.entries.tpl.php on line 270
"> »

This is a behavior that does not occur with the 2k11 template, for example. I have no idea what's going wrong here...

Greetings, T.

ttrueten avatar Jul 25 '22 13:07 ttrueten

@ttrueten Those are warnings related to the cache (Smarty) template files, have your tried clearing your template cache in the admin backend?

yellowled avatar Jul 25 '22 14:07 yellowled

@yellowled Yes, of course, that was the first thing I did. However, the error also occurs after deleting the cache files. Strangely enough, however, only in the pages created by the plugin serendipity_event_staticpage. In the normal pages / article views no problem.

Greetings, T.

ttrueten avatar Jul 27 '22 09:07 ttrueten

@ttrueten Dang, it, I was hoping that would fix it.

Unfortunately, I have been out of the loop with all things s9y, I don't even have a dev instance as of now that I could reproduce the error with. It sounds like something a "real" (backend) dev should have a look at, maybe it's related to a new PHP version or changes to the plugin.

yellowled avatar Jul 27 '22 10:07 yellowled

Thanks anyway for your hint, that could well have been.

T.

ttrueten avatar Jul 27 '22 10:07 ttrueten

I think I can give the background on this.

With PHP 8 all of our smarty templates had to be changed to not access variables that don't exist yet. Was okay before, just returned nothing, now it throws an error. And at least when we did the migration smarty had no method to automate this.

What's really confusing to me is that I actually really did test all core themes. But you say it only happens with the staticpage plugin? Those pages I did not test, probably.

Two options:

  1. You or we have to revisit the smarty template of bootstrap 4. Probably there is a section that only gets used with static pages. There we need to change the code to only access variables if they exist - see https://github.com/s9y/Serendipity/commit/1b162d33a87068fc19eb779677a4065b08d39a17 for an example commit that shows the kind of changes I talk about.
  2. Option two is to update the smarty library. There were subsequent releases I did not check on yet, but I saw support for PHP 8.1 even. Possible of course that it won't fix these kind of requirements, possible also that the new version 4 has breaking changes.

onli avatar Jul 27 '22 13:07 onli

Hi there, well, in 2k11, which I used to use and have now reactivated, the error does not occur. At least not in the frontend, but very well in the backend when I go into the template area. I made a screenshot that shows how the error occurs: 2022-07-27_19-07

The bug in Bootstrap 4 theme looks like this. What irritates me a bit is that the error appears obviously after the post. I don't know if this plays a role.... 2022-07-27_19-11

Greetings, T.

ttrueten avatar Jul 27 '22 17:07 ttrueten

I think this should be fixed in 2.5.0. I'll close here for now, please re-open if the issue is indeed not fixed yet.

onli avatar Feb 13 '24 20:02 onli