Where Is This Block Coming From?

Permalink
I have a page type of "press_release." Whenever I add a new page of that type, an autonav block appears in the sidebar. I've checked page defaults, and nothing is there. Where else could this possibly be coming from?

-Steve

Shotster
 
Shotster replied on at Permalink Reply
Shotster
An autonav block is automatically appearing in the sidebar of every newly created page regardless of page type. Why is this happening??? Anyone have a clue? There's absolutely nothing in any of the page defaults. I'm thoroughly confused at this point.

Thanks for any help you can provide,

-Steve
TravisN replied on at Permalink Reply
TravisN
Have you looked at the php code inside the page type. Chances are the block has been hard coded into the page type.
Shotster replied on at Permalink Reply
Shotster
Thanks Travis, it's definitely not hard coded. I implemented the theme and created the page types. I'm beginning to think it's some sort of DB corruption. Besides, I'm pretty sure it would show up on the "defaults" page if it's hard coded, and the defaults page is devoid of any blocks.

:-/

-Steve
Shotster replied on at Permalink Reply
Shotster
Is there such thing as an area default? This is happening only in the sidebar. Am I overlooking a C5 feature or something?

Also, anyone know how page defaults are stored in the DB?

-Steve
Shotster replied on at Permalink Reply
Shotster
There was apparently some old data in the DB. I deleted the "phantom" block being referenced, and there seems to be no side effects. I probably should have started with a fresh install after tinkering with C5 a while ago. Instead, I proceeded to build a site.

Anyway, is there a way to purge unused data from the database? I know there is "orphaned" data in there, as I changed some area names (e.g. "Main" to "Main Area") a while back. I don't see any such utility in the dashboard, but it seems it should be possible to somehow eliminate items that aren't referenced.

-Steve
agedman replied on at Permalink Reply
agedman
I haven't had this problem of phantom blocks, but I have also been bothered by the ambiguities in the gray area where the database interacts with the templates. I'm working on a free add-on that should help with this sort of thing by performing a snapshot analysis of themes, templates and areas from both the database side and the file system side to cobble together a set of reports. My plan is to make it highlight possible issues such as blocks assigned to areas that no longer exist in templates.
Shotster replied on at Permalink Reply
Shotster
That sounds really useful! You are definitely far more knowledgeable than I about C5's inner workings to write such a utility. I will keep an eye out for it in the marketplace.

-Steve
agedman replied on at Permalink Reply
agedman
Thanks Steve! I'll be sure to keep you in the loop. I'm not knowledgeable at all, just trying to figure it out as I go along. At this point, I've only got the first piece of the puzzle done. It uses the PHP token_get_all() to convert a template to tokens, recursively check any elements that get included by $this->inc() and identify all the areas and their handles (i.e. new Area('arHandle')). It also supports Jordan's new GlobalArea('arHandle','optional template_path'). But there's lots more to do...
DragonReeper replied on at Permalink Reply
DragonReeper
As much as I can make out of the document structure it's :
Template->Layout->Page type.

Try Different Templates, Layouts etc. just so that you can figure out where the problem lies.

anyway good luck.