Invalid Area message after editing block

Permalink
Hi,
Has anyone else seen this issue on 5.6.x? On a couple of my sites, I have this problem after I edit a block.

I go into EDIT mode, click on a block in an area and choose EDIT, make changes in the block editor, SAVE in the block editor.

When the editor closes to show changes, the block is gone and a message saying "INVALID AREA" is in its place. If I publish changes, all my changes are there and everything is fine. Here's a vid:

http://youtu.be/I0c7SR7lEgY

jmcgarvey
 
jordif replied on at Permalink Reply
jordif
Hi,

what version of concrete 5.6 are you using? It seems there was an issue in 5.6.3.1 with global areas:

https://github.com/concrete5/concrete5-legacy/issues/1505...
http://www.concrete5.org/index.php?cID=621912...

Regards,

Jordi
jmcgarvey replied on at Permalink Reply
jmcgarvey
Thanks, Jordi. I am using 5.6.3.4 - was this fixed by then?
jordif replied on at Permalink Reply
jordif
Hi,

I've just checked and it seems this was never fixed :(

So what you're trying to edit is a Stack within a Global Area?

If so, you could either try to use blocks instead of a Stack in that Global Area or try to apply the patch:

http://www.concrete5.org/index.php?cID=621912...

(where lines starting with - need to be deleted and lines starting with + need to be added)

If you try to apply the patch, back up the old file in case something goes wrong (and try this locally first if you can)


Jordi
LaurenceMommers replied on at Permalink Reply
i dont think this is the fix he needs, he can try for sure, but his message is generated in :
edit_block_popup.php (line 7).

This patch is fixing edit_area_popup.php, but while editing a block this file isn't used.
LaurenceMommers replied on at Permalink Reply
Hello,

I tried to track this issue down in version 5.6.3.4, but the only reason i can come up with is an invalid cache, dit you try clearing the cache? ( even when you have it disabled )
jmcgarvey replied on at Permalink Reply
jmcgarvey
Yep - killed the cache. It doesn't happen in every area... just a few.
LaurenceMommers replied on at Permalink Reply
hmm, weird issue,

The other 2 possibilities are:
$c = Page::getByID($_REQUEST['cID'], 'RECENT');
$a = Area::get($c, $_REQUEST['arHandle']);
if (!is_object($a)) {
   die('Invalid Area');
}


that this line fails: $c = Page::getByID($_REQUEST['cID'], 'RECENT');
or this one $a = Area::get($c, $_REQUEST['arHandle']);

but if it's not the cache then they are both almost just direct calls to the database.

do you know how to open the database? maybe you can give me an export of the tables "Pages", "Collections", "PagePaths" and "Areas". Not sure if i can find anything with those tables but it i think that the problem almost has to be in there..
LaurenceMommers replied on at Permalink Reply
One thing i missed, do you have (or had) a normal Area with the same name on the same page?

i just realized that this code is executed with $arIsGlobal = null.
$globalCache = $arIsGlobal ? ':1' : '';
$a = CacheLocal::getEntry('area', $c->getCollectionID() . ':' . $arHandle . $globalCache);


so that could mean that a global area and a normal area with the same name ('handle') could collide