Closed (duplicate)
Project:
Features
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2015 at 12:54 UTC
Updated:
18 Mar 2016 at 18:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
logaritmisk commentedComment #3
Sneakyvv commentedThe problem, in my opinion, is that (some of) the static variables are stored by reference. When taken into the $static variable they are still referencing the original variable. Then, when drupal_static_reset is called, also the values (references) in the $static variable are reset.
I've attached a simpeler patch which solves this problem by copying the values in a foreach, which, since it copies the values by nature, removes the references. Then this 'clean' $static_copy is used to restore the static variables.
But as mentioned in #2603578: _features_set_export_language is clearing drupal static cache too aggressively breaking search and possible many other modules , the features module can not know about each and every variable that needs to be restored. So if there's a solution there, go with that instead. Now the solution is to remove the _features_set_export_language call, but that seems to be only a workaround.
Comment #4
Sneakyvv commentedAdded patch with inline documentation.
Comment #5
b-prod commentedActually I think this patch should be applied quickly as it solved an issue that was introduced recently.
We can continue to think about a better way to handle the static variables in the issue #2603578: _features_set_export_language is clearing drupal static cache too aggressively breaking search and possible many other modules
Comment #6
b-prod commentedComment #7
mpotter commentedDiscussing this over in #1988252: Use the same language consistently in generated comments and strings but putting this patch on hold till we can find a resolution to this whole language_set and static cache clearing mess instead of just trying to patch all around it.
Comment #8
mpotter commentedMoving the discussion and new patches for this over to issue #2603578: _features_set_export_language is clearing drupal static cache too aggressively breaking search and possible many other modules
Comment #9
mpotter commented