Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Object of class stdClass could not be converted to string in esi_panels_url() (line 195 af ..../drupal7/sites/all/modules/contrib/esi/modules/esi_panels/esi_panels.module).
It seems that
// Add all the display arguments to the end of the URL.
$url .= '/' . implode('/', $display->args);
crashes. Args can be objects.
It happened when the ESI cache was enabled in a pane on a panels_everywhere site template.
Comment | File | Size | Author |
---|---|---|---|
#7 | esi-panel-url-display-args-1841588-7.patch | 681 bytes | lwalley |
#5 | 1841588_esi_panel_cache_fails_5.patch | 755 bytes | uzlov |
#2 | 1841588_esi_panel_cache_fails.patch | 634 bytes | sam3k |
Comments
Comment #1
sam3k CreditAttribution: sam3k commentedIt seems like it is used to generate a unique identifier?
I am having the same issue, without panels everywhere (just using panels). Assuming that it will be used to create a unique identifier, I did the following:
This sent the error away, and now I see the esi tag baked in the HTML of the pane where I enabled the esi cache. But, to be honest, still don't know if it works as my varnish is not caching at the moment.
Comment #2
sam3k CreditAttribution: sam3k commentedAttaching a patch.
Comment #3
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedpatch doesn't apply
i think it has to be done from within the esi directory
Comment #4
IRuslan CreditAttribution: IRuslan commentedSeems patch has no sense.
Normally $display->args could not be an object.
But $display->args[0] is object in most of cases.
As a result implode('/', array_keys($args)) will return '0', which is not pretty useful.
I think idea of add display args should be reviewed. Because i don't see clear way to handle all $display->args values within URL.
It could contain big set of data (nested arrays and etc).
Comment #5
uzlov CreditAttribution: uzlov at Skilld commentedanother variant of patch
don't add anything if we have array with NOT string elements
Comment #6
andypostLooks
is_scalar()
more appropriate here, otoh ...#4 said
so maybe just skip this (0) and research what should be there exactly
looks that needs
break
after settingFALSE
Comment #7
lwalley CreditAttribution: lwalley commentedRe-generated @uzlov's patch (#5) from esi module root, includes break suggested by @andypost.
Comment #8
ron_s CreditAttribution: ron_s commentedThis patch existed on a separate thread since 2014, just wasn't marked for review: https://www.drupal.org/project/esi/issues/2219671
Should decide which of these two to use.
Comment #9
ron_s CreditAttribution: ron_s commentedI think the other version might be a better option, because it at least adds something if some of the $arg values are strings, rather than skipping all $args. Also when debugging, it provides some direction on where the issue might exist.
Comment #10
dstuart CreditAttribution: dstuart at Axis12 Limited commentedClosing in favour of https://www.drupal.org/project/esi/issues/2219671