Closed (fixed)
Project:
Context
Version:
6.x-2.0-beta7
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Sep 2009 at 16:21 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
batje commentedThis seems to be only when exporting multiple contexts, using admin/build/context/export
Exporting a single context generates correct code.
Comment #2
micheI am experiencing the same error. If I have exported my contexts (but haven't deleted them from database yet so they should be considered Overridden) or if I have deleted them from the database (so they are considered Default), this error appears on all pages.
If I comment out my MODULENAME_context_default_contexts function, then the error disappears.
I changed priority to critical as the module doesn't appear to be working as designed.
Comment #3
ebeyrent commented+1
Comment #4
ebeyrent commentedIt appears that removing the stdClass::__set_state() and leaving just an array works just fine.
Comment #5
micheI agree with comment #4. Implemented per the link in this issue's description.
Comment #6
James Andres commentedHere's a patch that resolves the issue for me. I just replaced the
stdClass::__set_state()with a cast to(object)which is semantically the same. Same enough at least.This should work on PHP 4 as well as 5, though I haven't actually tested in PHP 4.
Comment #7
fearlsgroove commentedThere's an underlying issue there somewhere, which is how is it that there are unexpectedly objects being returned for context to export? I don't know the answer to that, but this patch converts them to arrays, similarly to #215375: Fatal error: Call to undefined method stdClass::__set_state(), instead of relying on string replacement. So, this doesn't fix whatever the root problem is but it heads off the issue sufficiently to warrant consideration for commit in the meantime
Comment #8
steven jones commentedNeeds to be fixed for 2.x
Comment #9
fearlsgroove commentedI should note this before I forget ... the bulk export produces the arrays wrapped in a function, presumably to be included with a module, and does not import successfully. This appears to be by design ... Exporting contexts individually does seem to work. I can't reproduce the circumstances to created objects for the "block" values of the exported contexts, which is what in turn caused the invalid export code above.
Comment #10
steven jones commentedFixed in 2.x