This topic was marked solved by its starter, on March 16th, 2013, 01:36 AM
Undefined index in wetem::find

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Undefined index in wetem::find
« on April 25th, 2012, 08:04 AM »
If the target layer/block doesn't exist, $to is never defined.

Case in point: I have added a block to the body, which works fine, The problem comes in XML mode, where the layer isn't registered.
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Undefined index in wetem::find
« Reply #1, on April 26th, 2012, 05:08 PM »
How could it return an undefined index on $to? $to is never used as an index, AFAIK...?

As for what you're describing -- it's actually addressed in the wetem::find source code.

Code: [Select]
// If we try to insert a sideback block in XML or minimal mode (hide_chrome), it will fail.
// Plugins should provide a 'default' fallback if they consider it vital to show the block, e.g. array('sidebar', 'default').

So there you go... Just add , 'default' right after the name of the layer where you want to add :)

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670

Nao

  • Dadman with a boy
  • Posts: 16,082