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.
Getting the following error comes up every time I attempt to export a feature when the name module is installed. This happens regardless of whether or not name fields are included in the feature. This is using PHP 5.4.
PHP Fatal error: Cannot create references to/from string offsets nor overloaded objects in /htdocs/.../includes/common.inc on line 6548
The error is coming up in the function drupal_array_set_nested_value. If do a dpm() for $value, it comes up as 'sources.'
Any idea what's going on here?
Comment | File | Size | Author |
---|---|---|---|
#25 | php-error-exporting-features-1987018-01.patch | 3.3 KB | christowm |
#19 | name-1987018-19-features-followup.patch | 827 bytes | Alan D. |
#15 | name-feature_export_error-1987018-15.patch | 2.06 KB | jlapp |
Comments
Comment #1
Alan D. CreditAttribution: Alan D. commentedRemoving the name_features_api() function at the bottom of name.module will probably resolve this if urgent. What version of Features?
Related #1890178: Cannot Recreate Features
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedFeatures version 7.x-2.0-beta2.
Yeah, not sure how to debug this. Spent a couple hours trying to trace things back from drupal_array_set_nested_value. Sources comes up all the time as $value - strikes me as some kind of a runaway function.
I appreciate you for taking the time to provide the feedback!
Comment #3
Alan D. CreditAttribution: Alan D. commentedCan you try this if you are still interested in helping debug this:
Comment #4
dealancer CreditAttribution: dealancer commentedthanks for an advice, but it does not work when dealing with fatal errors.
Here is work around:
Comment #5
humansky CreditAttribution: humansky commentedGetting the same error with Features 7.x-2.0-beta2 and Name 7.x-1.8 all running on Drupal core 7.22. Here is my backtrace:
( ! ) Fatal error: Cannot create references to/from string offsets nor overloaded objects in /includes/common.inc on line 6548
Call Stack
# Time Memory Function Location
1 0.0001 358416 {main}( ) ../index.php:0
2 1.6841 10469428 menu_execute_active_handler( ) ../index.php:21
3 1.6895 10848200 call_user_func_array ( ) ../menu.inc:517
4 1.6895 10848420 drupal_get_form( ) ../menu.inc:517
5 1.6896 10848944 drupal_build_form( ) ../form.inc:131
6 1.6941 11051920 drupal_process_form( ) ../form.inc:374
7 1.6942 11053580 form_builder( ) ../form.inc:842
8 1.7033 11395568 form_builder( ) ../form.inc:1857
9 1.7593 11916824 form_builder( ) ../form.inc:1857
10 1.7594 11920032 form_builder( ) ../form.inc:1857
11 1.7596 11924784 form_builder( ) ../form.inc:1857
12 1.7596 11925120 _form_builder_handle_input_element( ) ../form.inc:1795
13 1.7596 11925452 drupal_array_set_nested_value( ) ../form.inc:2003
Hope this helps. Let me know if you want me to test any code/patches.
Comment #6
Alan D. CreditAttribution: Alan D. commentedk, wasn't helpfil :(
I am wondering if two modules are defining the component 'name'
<?
dpm(features_get_components());
?>
If all is ok, things will be similar to:
If there is a conflict then it will look like this:
Comment #7
jlapp CreditAttribution: jlapp commentedI am also getting this error after upgrading to Name 7.x-1.8.
Comment #8
Alan D. CreditAttribution: Alan D. commented@jlapp
The same error? Only when doing things related to features?
I'm running features + name and having no issues, difficult to debug :(
If anyone is willing to share a db dump + sites/module folder please PM me and I will provide an email address to send to
Comment #9
Alan D. CreditAttribution: Alan D. commentedOr can someone try this:
ie: replace name with namefield and completely flush your caches and registry
Comment #10
humansky CreditAttribution: humansky commentedI changed 'name' to 'namefield' and still get this error. Also, I was able to easily replicate this error. If I leave the Feature name to blank, I don't get an error. As soon as I enter a Feature name and then attempt to download it, I get the above error.
Comment #11
Alan D. CreditAttribution: Alan D. commentedSo limited to some Features 2.x versions. Renaming to namefield worked for me.
@humansky did you flush the cache? Running update.php will be enough.
Root cause is what is likely to be a core bug in the FAPI that is probably worth none of our time chasing, namely there are two name FAPI elements on the page and this is confusing drupal element lookup.
Will tag and release if people are happy with this. (already pushed to dev name => namefield)
Comment #12
jlapp CreditAttribution: jlapp commentedAlan D, thanks for your quick responses. Yes, I am getting the same error that others are reporting only when recreating a feature (right after clicking the "Download" button). I will try your latest dev version today and report back with the results.
Comment #13
humansky CreditAttribution: humansky commented@Alan D. I did clear the cache.....but I changed the wrong 'name' key.....UGGG. Either way, I changed the correct field to 'namefield' and cleared cache several times, now it works. Thank you!!! I apologize for the misguidance, it was late :-)
Comment #14
Alan D. CreditAttribution: Alan D. commentedI have jumped the gun and pushed it into 7.x-1.9.
My development was with Features 7.x-1.x (only locally running system with Features) that had no issues. :/
Comment #15
jlapp CreditAttribution: jlapp commentedThanks again Alan D. I tried version 7.x-1.9 and after a cache clear am able to export features again. However, with 7.x-1.9 I no longer have the ability to export Name Formats (the NAME FORMATS section is missing from the COMPONENTS list on the feature creation page).
I believe the issue stems from changing the $component in name_features_api() from "name" to "namefield". For all of the Features hooks, the Features API docs state:
"The hook should be implemented using the name ot the component, not the module, eg. [component]_features_export() rather than [module]_features_export()."
I have updated all of the implementations of Feature hooks and a couple of other places where the component is referenced and that seems to restore the Name Formats export functionality for me. Please see the attached patch for your review. This is my first experience implementing Feature hooks, so please let me know if anything looks off in my patch.
Comment #16
jlapp CreditAttribution: jlapp commentedComment #17
impleri CreditAttribution: impleri commentedConfirmed that changing things to namefield in #9 and #15 fixes the 500 error.
Comment #18
Alan D. CreditAttribution: Alan D. commentedCrazy. I changed and managed to export after the change. Now it doesn't... maybe another level of caching somewhere... or I simply stuffed up after trying to quickly do this after an 80 hour week at work :P
I have tested and pushed jlapp's code to dev.
I still need to remove the id's from the export, so back to needs work
Comment #19
Alan D. CreditAttribution: Alan D. commentedThis one removes the db serial id. Now, hopefully we can put this issue to bed :)
Reopen if there are any issues. No plans to re-roll for this fix, but dev should be fairly static for a long time until I finally get around to figuring out the last remaining bug for i18n integration.
Comment #20
jlapp CreditAttribution: jlapp commentedThanks so much for your work on this issue Alan D! I'll update to the latest dev release with the removed DB ID in the next couple of days.
Comment #21
Alan D. CreditAttribution: Alan D. commentedI should be thanking you for your follow up in #15! Same for everyone else who helped!
It will teach me to cut n paste a new feature in, particularly just before releasing a new version.
Comment #22
liza CreditAttribution: liza commentedsorry to ask Alan,
could we please have this patch include changes for the previous patch? your patch isn't reflecting the actual code of the file but changes after the 1st patch. that's kind of confusing :\
thanks for getting this figured out as fast as y'all did.
Comment #23
Alan D. CreditAttribution: Alan D. commentedEverything is in the latest dev version, so no patches are required. :)
This is the only fix in dev and there is unlikely to be any activity for months now there.
If you need one, just overwrite 1.9 with dev (excluding name.info) and generate a patch from that.
Comment #25
christowm CreditAttribution: christowm commentedHi Alan,
I just created the patch between 1.9 and the dev version. It is attached to this note, just in case for those folks that want to apply the diff quickly in their environment.
Cheers,
Mitch