Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
PHP 8.4 “Undefined variable $groupby ” warning with txp:images
(because Homebrew was nagging I updated the local server)
PHP8.4.1, TXP 4.9-dev uptodate, debug mode.
Warning: Undefined variable $groupby Issue detected while parsing form None on page playground
Input (in the <head />
):
<if::article_image>
<txp:images>
<meta property="og:image" content="<image::url escape="html" />" />
<meta property="og:image:width" content="<image::info type="w" />" />
<meta property="og:image:height" content="<image::info type="h" />" />
<meta property="og:image:alt" content="<image::info type="alt" />" />
</txp:images>
</if::article_image>
I also insert images in the body of the article with <txp:images />
which triggers the warning but that is nested in complex shortcode. The little block above is easier to parse.
On the admin side everything seems to hold fine with PHP 8.4, so far.
–^–
Edit
Noticed now, that test page is supposed to load two more images that are completely missing. With older PHP I thought I had a least a warning that the requested by the txp:shortcode was missing. The shortcode: <txp::pw_imageL id="30,25" />
; the image with ID-30
is missing from the system.
This needs further testing
Last edited by phiw13 (Yesterday 03:06:18)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: PHP 8.4 “Undefined variable $groupby ” warning with txp:images
After reviewing and testing some more, this not really new nor any sort of “bug”. This can be reproduced with PHP 8.3. Every case that throws an error is because the requested image ID is missing from the DB and the associated image is not on the file system (anymore).
It is, in this case a very poorly formulated description for the issue at hand.
I don’t know if that can be improved from the Textpattern side or if that is a PHP issue.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: PHP 8.4 “Undefined variable $groupby ” warning with txp:images
A search for “Undefined variable $groupby” reveals some interesting results of mostly WP sites totally crashing.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: PHP 8.4 “Undefined variable $groupby ” warning with txp:images
We should guard against empty image results so this smells like a bug to me.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
Re: PHP 8.4 “Undefined variable $groupby ” warning with txp:images
Could you post more diagnostics (line numbers) please? Can not reproduce on my side.
Offline
Re: PHP 8.4 “Undefined variable $groupby ” warning with txp:images
Here you go, sorry for forgetting that. This is for the sample given in the OP.
textpattern/vendors/Textpattern/Tag/Syntax/Image.php:389 parseList()
Textpattern\Tag\Syntax\Image::images()
textpattern/vendors/Textpattern/Tag/Registry.php:138 call_user_func()
textpattern/lib/txplib_publish.php:534 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:423 processTags()
textpattern/publish/taghandlers.php:1911 parse()
if_article_image()
textpattern/vendors/Textpattern/Tag/Registry.php:138 call_user_func()
textpattern/lib/txplib_publish.php:534 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:423 processTags()
If that matters, article status is “Live”, not much special at all in the meta-data fields
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: PHP 8.4 “Undefined variable $groupby ” warning with txp:images
Thanks, should be fixed now, sorry for the trouble.
Offline
Re: PHP 8.4 “Undefined variable $groupby ” warning with txp:images
etc wrote #338340:
Thanks, should be fixed now, sorry for the trouble.
Yes! No more warning all over.
Thank you.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline