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

<p><a href="https://i.sstatic.net/TzTqn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TzTqn.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2016-05-20T13:06:33.647Z
2016-05-20T13:06:33.647Z
willhibberd
<p>I'm getting this error when saving a post which has a Matrix field.</p>

<pre><code>Craft\EntryModel and its behaviors do not have a method or closure named "ui".
</code></pre>

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

<p>Can anyone help with a fix for this.</p>

<p>My Stack Trace:</p>

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

<matrix><saveentry><onsaveentry>
Craft\EntryModel and its behaviors do not have a method or closure named "ui"
# Craft\EntryModel and its behaviors do not have a method or closure named "ui"

(Asked by: username_0 on 2016-05-20)

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...")

**Tags:** matrix, saveentry, onsaveentry


---

## 1 answers

### Answer by username_0 on 2016-05-20. Score: 2 | Accepted answer

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

[![enter image description here](https://i.sstatic.net/TzTqn.png)](https://i.sstatic.net/TzTqn.png)


---

