2

I'm getting this error when saving a post which has a Matrix field.

Craft\EntryModel and its behaviors do not have a method or closure named "ui".

I have ran a search in my templates and don't have a closure named "ui" anywhere...

Can anyone help with a fix for this.

My Stack Trace:

#0  
    +  /Users/Local Dev/site-title/craft/app/models/BaseModel.php(119): CComponent->__call("ui", array())
    #1  
    +  /Users/Local Dev/site-title/craft/app/vendor/twig/twig/lib/Twig/Template.php(609): Craft\BaseModel->__call("ui", array())
    #2  
    +  /Users/Local Dev/site-title/craft/app/etc/templating/BaseTemplate.php(64): Twig_Template->getAttribute(Craft\EntryModel, "ui", array(), "any", ...)
    #3  
    +  /Users/Local Dev/site-title/craft/storage/runtime/compiled_templates/29/293cae55ba17fb39e41eb647a3f0ea1d9993a92c11c0f92b88df31e0da72ed53.php(19): Craft\BaseTemplate->getAttribute(Craft\EntryModel, "ui", array())
    #4  
    +  /Users/Local Dev/site-title/craft/app/vendor/twig/twig/lib/Twig/Template.php(381): __TwigTemplate_565b9119d77fab485839787af49f6670acfedc6911aa119352914b227f9662d7->doDisplay(array("object" => Craft\EntryModel, "craft" => Craft\CraftVariable, "blx" => Craft\CraftVariable, "now" => Craft\DateTime, ...), array())
    #5  
    +  /Users/Local Dev/site-title/craft/app/etc/templating/BaseTemplate.php(26): Twig_Template->displayWithErrorHandling(array("object" => Craft\EntryModel, "craft" => Craft\CraftVariable, "blx" => Craft\CraftVariable, "now" => Craft\DateTime, ...), array())
    #6  
    +  /Users/Local Dev/site-title/craft/app/vendor/twig/twig/lib/Twig/Template.php(355): Craft\BaseTemplate->displayWithErrorHandling(array("object" => Craft\EntryModel, "craft" => Craft\CraftVariable, "blx" => Craft\CraftVariable, "now" => Craft\DateTime, ...), array())
    #7  
    +  /Users/Local Dev/site-title/craft/app/vendor/twig/twig/lib/Twig/Template.php(366): Twig_Template->display(array("object" => Craft\EntryModel))
    #8  
    +  /Users/Local Dev/site-title/craft/app/services/TemplatesService.php(335): Twig_Template->render(array("object" => Craft\EntryModel))
    #9  
    +  /Users/Local Dev/site-title/craft/app/helpers/ElementHelper.php(122): Craft\TemplatesService->renderObjectTemplate("{parent.ui}/{slug}", Craft\EntryModel)
    #10 
    +  /Users/Local Dev/site-title/craft/app/services/ElementsService.php(1537): Craft\ElementHelper::setUniqueUri(Craft\EntryModel)
    #11 
    +  /Users/Local Dev/site-title/craft/app/services/EntriesService.php(176): Craft\ElementsService->saveElement(Craft\EntryModel)
    #12 
    +  /Users/Local Dev/site-title/craft/app/controllers/EntriesController.php(458): Craft\EntriesService->saveEntry(Craft\EntryModel)
    #13 
    +  /Users/Local Dev/site-title/craft/app/framework/web/actions/CInlineAction.php(49): Craft\EntriesController->actionSaveEntry()
    #14 
    +  /Users/Local Dev/site-title/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams(array("p" => "admin/entries/sections/58-black-sun"))
    #15 
    +  /Users/Local Dev/site-title/craft/app/framework/web/CController.php(286): CController->runAction(CInlineAction)
    #16 
    +  /Users/Local Dev/site-title/craft/app/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array())
    #17 
    +  /Users/Local Dev/site-title/craft/app/framework/web/CWebApplication.php(282): CController->run("saveEntry")
    #18 
    +  /Users/Local Dev/site-title/craft/app/etc/web/WebApp.php(815): CWebApplication->runController("entries/saveEntry")
    #19 
    +  /Users/Local Dev/site-title/craft/app/etc/web/WebApp.php(285): Craft\WebApp->_processActionRequest()
    #20 
    +  /Users/Local Dev/site-title/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
    #21 
    +  /Users/Local Dev/site-title/craft/app/index.php(62): CApplication->run()
    #22 
    +  /Users/Local Dev/site-title/public/index.php(19): require_once("/Users/Local Dev/site-title/craft/app/index...")
2

My mistake... I had {parent.ui} as the nested entry slug for the section. {parent.uri} is correct.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.