You are not logged in.

  • "MajorWinters" started this thread

Posts: 33

Location: Belgium

Occupation: Software developer

  • Send private message

1

Wednesday, September 9th 2009, 6:39pm

WCF ACP header.tpl calling wrong class

This error occurs when clicking the submit button on a form (ACP) I created: MenuAddForm.class.php. Something is probably wrong in my code but I don't have an idea where to look right now. Other pages like MenuListPage.class.php work without error.

Source code

1
[09-Sep-2009 18:22:20] PHP Fatal error:  Call to undefined method CMSMenuEditor::getActiveMenuItems() in /var/www/clients/client1/web3/web/subdomains/beta/wcf/acp/templates/compiled/1_1_header.php on line 110


WCF ACP header.tpl:

Source code

1
2
3
var menuItemData = new Array();
			{counter start=-1 print=false}
			{foreach from=$menu->getMenuItems() item=items}


Source code

1
2
3
var activeMenuItems = new Array();
			{counter start=-1 print=false}
			{foreach from=$menu->getActiveMenuItems() item=menuItem}
And if someone gave you a pile of gold, you'd probably complain that it was too heavy.

  • "MajorWinters" started this thread

Posts: 33

Location: Belgium

Occupation: Software developer

  • Send private message

2

Wednesday, September 9th 2009, 8:18pm

After a 2 hour code review I found the issue, my mistake:

WCF::getTPL()->assign(array(
'menu' => $this->menuEditor,
'success' => true
));

Assigning menu again while it already has been assigned :D :whistling:
And if someone gave you a pile of gold, you'd probably complain that it was too heavy.