backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 40 forks source link

Fix PHP Fatal error: Cannot create references to/from string offsets. (date module) #4267

Closed jenlampton closed 1 year ago

jenlampton commented 4 years ago

The below was copied from https://github.com/backdrop/backdrop-issues/issues/4027 because I'd like to get the fatal error fixed, and in order to do so we need an issue for the patch :)

Today I ran into this issue that has been resolved in the Drupal date module, so I decided to create this meta to get caught up with Date module for Backdrop. I've also filed a PR for only that issue so that I could get my site working again. I hope to have time to address some of these other changes soon too!

Original Drupal issue: https://www.drupal.org/project/date/issues/2449261

How to reproduce

You get

A bunch of errors and Cannot create references to/from string offsets.

A screenshot: illegal-string-offset


PR: https://github.com/backdrop/backdrop/pull/2868

jenlampton commented 4 years ago

PR updated on Jan 28. Updating issue tags :)

docwilmot commented 4 years ago

It would be great to have a more detailed explanation of what this issue is. The D7 issue seems to be about embedded Views in Panel Panes?? We don't have that, so we need some translation to our situation please.

docwilmot commented 4 years ago

It would be great to have a more detailed explanation of what this issue is. The D7 issue seems to be about embedded Views in Panel Panes?? We don't have that, so we need some translation to our situation please.

indigoxela commented 4 years ago

I agree with @docwilmot - we really need the steps to reproduce this. A short experiment has been successful, though.

How to reproduce

You get

A bunch of errors and Cannot create references to/from string offsets.

A screenshot: illegal-string-offset

indigoxela commented 4 years ago

...garbage, I wanted to import that demo view in the sandbox (for easier reproduction), but the link leads to the installer. The sandbox was too old, I guess.

@jenlampton mind to restart the sandbox?

indigoxela commented 4 years ago

@jenlampton many thanks for updating the sandbox.

Without this PR following url would be a breaker: http://2868.backdrop.backdrop.qa.backdropcms.org/test-date-filter?date_filter[value]foobar

But it isn't in the sandbox.

To compare it with an install without that patch, export the view admin/config/development/configuration/single/export and import it to your test site.

Then go to /test-date-filter and add ?date_filter[value]foobar in your browser's url bar. You'll get "Cannot create references to/from string offsets "

indigoxela commented 3 years ago

The PR still looks fine to me, but a Drupal issue comment worries me ("This broke the Search API Views integration with a fatal error").

Search API has been ported to Backdrop, so this change might be a contrib breaker. How can we verify that it isn't?

herbdool commented 2 years ago

@indigoxela the search API module made this fix https://git.drupalcode.org/project/search_api/-/commit/a2bdfe7 so should be able to merge this once that's fixed.

herbdool commented 2 years ago

I've reported it and likely search API will get a fix soon. I think we can merge this soon.

quicksketch commented 2 years ago

We keep bumping this issue to the next release. I believe we're dependent on https://github.com/backdrop-contrib/search_api/issues/24 to be completed first, before this should be merged in core? Or can we merge it at any time?

ghost commented 2 years ago

Removing from the milestone since this is blocked.

laryn commented 1 year ago

I've applied to be a co-maintainer of search_api to help unblock this.

laryn commented 1 year ago

I have pulled all the latest commits from the D7 version of search_api (including the one @herbdool mentions above) into the Backdrop version. No release yet -- anyone else willing to test? https://github.com/backdrop-contrib/search_api

laryn commented 1 year ago

I am testing this patch on a live site that exhibited this error in the logs periodically related to a particular URL, and it is working well.

laryn commented 1 year ago

Thanks to @jenlampton, @klonos, @quicksketch, @indigoxela, and @herbdool for the work on this one, building on the D7 patch by daniel_j, pcho, joseph.olstad, David Hernández, collinhaines, vinmassaro, and SkyNet Costa Rica. (Finally) merged into 1.x and 1.26.x.