A fresh install of context 6.x-2.0-beta7 cannot import it's own exports. The problem is the import performed roughly as eval "return {$import}";, however the $import string does not contain a trailing semicolon, so eval crashes out.

The attached patch is a simple fix, perhaps overly simple :-).

Comments

dixon_’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm that the patch fixes the problem.

vgarvardt’s picture

Status: Reviewed & tested by the community » Needs work

Patch does not work or me either.

I get the following error records in log n import:
- Invalid argument supplied for foreach() in /home/besttrav/public_html/includes/common.inc on line 914.
- strtr() [function.strtr]: The second argument is not an array in /home/besttrav/public_html/includes/common.inc on line 931.

steven jones’s picture

Status: Needs work » Fixed

Thanks for the patch James, I've made it so that the single export produces valid PHP, and that the import adds a semi-colon as per your patch. Hopefully that'll make things a little easier for everyone.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

fearlsgroove’s picture

Status: Closed (fixed) » Needs work

issue in #2 still exists --- I can't successfully import anything in 2.0-beta7

steven jones’s picture

Status: Needs work » Closed (fixed)

It's fixed in the dev versions of context 2, and will be released in 6.x-2.8

fearlsgroove’s picture

I was using 2.x from CVS and it's not fixed, but it's also not the same issue. See: #584672: Error on Import: stdClass::__set_state()