<p>I was able to fix the issue - it had to do with the URL structure I had set in the Section's URL format area. For nested entries, I had put {parent-uri}/{slug} when in fact it needed to be {parent.uri}/{slug}.</p>

<p>I can now assign parents to entries and this is reflected in the URLs on the front end.</p>

CC BY-SA 3.0
2017-10-15T07:37:46.497Z
2017-10-15T07:37:46.497Z
Jodi
<p>I was changing some entry types to allow for a parent/child structure when I realised that this was already something Craft could do natively. When I undid my changes and attempted to assign a parent page, I am given the following error: </p>

<blockquote>
  <p>Object of class Craft\Entry Model could not be converted to int.</p>
</blockquote>

<p>I am still fairly new to Craft so I am quite limited in understanding exactly what I did to break it. I can still create and edit entries, I just can't set a parent page anymore.</p>

<pre><code>******************************************************************************************************
2017/10/13 22:37:16 [warning] [application] There was a problem parsing the feed: cURL error 60: SSL certificate problem: unable to get local issuer certificate

******************************************************************************************************
2017/10/13 22:37:58 [error] [php] Object of class Craft\EntryModel could not be converted to int (C:\wamp64\www\craft\storage\runtime\compiled_templates\9a\9a68f00c27a5bff3f289231a8d85ef2d821f962bf46e9f246c88cce64dc926f2.php:19)
Stack trace:
#0 C:\wamp64\www\craft\app\etc\templating\BaseTemplate.php(26): __TwigTemplate_22da5c53ac1ef5202e2f12c05417214f2feda1f7c6b451fbb37fa9ade742e5bd-&gt;displayWithErrorHandling()
#1 C:\wamp64\www\craft\app\vendor\twig\twig\lib\Twig\Template.php(403): __TwigTemplate_22da5c53ac1ef5202e2f12c05417214f2feda1f7c6b451fbb37fa9ade742e5bd-&gt;displayWithErrorHandling()
#2 C:\wamp64\www\craft\app\vendor\twig\twig\lib\Twig\Template.php(411): __TwigTemplate_22da5c53ac1ef5202e2f12c05417214f2feda1f7c6b451fbb37fa9ade742e5bd-&gt;display()
#3 C:\wamp64\www\craft\app\services\TemplatesService.php(388): __TwigTemplate_22da5c53ac1ef5202e2f12c05417214f2feda1f7c6b451fbb37fa9ade742e5bd-&gt;render()
#4 C:\wamp64\www\craft\app\helpers\ElementHelper.php(122): Craft\TemplatesService-&gt;renderObjectTemplate()
#5 C:\wamp64\www\craft\app\services\ElementsService.php(1556): setUniqueUri()
#6 C:\wamp64\www\craft\app\services\EntriesService.php(176): Craft\ElementsService-&gt;saveElement()
#7 C:\wamp64\www\craft\app\controllers\EntriesController.php(462): Craft\EntriesService-&gt;saveEntry()
#8 C:\wamp64\www\craft\app\framework\web\actions\CInlineAction.php(49): Craft\EntriesController-&gt;actionSaveEntry()
#9 C:\wamp64\www\craft\app\framework\web\CController.php(308): CInlineAction-&gt;runWithParams()
#10 C:\wamp64\www\craft\app\framework\web\CController.php(286): Craft\EntriesController-&gt;runAction()
#11 C:\wamp64\www\craft\app\framework\web\CController.php(265): Craft\EntriesController-&gt;runActionWithFilters()
#12 C:\wamp64\www\craft\app\framework\web\CWebApplication.php(282): Craft\EntriesController-&gt;run()
#13 C:\wamp64\www\craft\app\etc\web\WebApp.php(823): Craft\WebApp-&gt;runController()
#14 C:\wamp64\www\craft\app\etc\web\WebApp.php(287): Craft\WebApp-&gt;_processActionRequest()
#15 C:\wamp64\www\craft\app\framework\base\CApplication.php(185): Craft\WebApp-&gt;processRequest()
#16 C:\wamp64\www\craft\app\index.php(62): Craft\WebApp-&gt;run()
#17 C:\wamp64\www\public_html\index.php(19): require_once()
REQUEST_URI=/public_html/admin/entries/pages/90-cherries
</code></pre>

CC BY-SA 3.0
2017-10-13T11:42:55.180Z
Do you get this error in the Craft control panel?
carlcs
CC BY-SA 3.0
2017-10-13T15:55:15.650Z
What kind of section did you initially create: channel?
RitterKnight
CC BY-SA 3.0
2017-10-13T22:36:39.187Z
I made the items as the type 'Structure'. The error is thrown when I click the 'Save' button. I can edit the page's other fields etc and click 'Save' successfully, but when I add the parent page, and then Save, that is when the error is thrown.
Jodi
CC BY-SA 3.0
2017-10-14T06:28:50.087Z
So an error in the CP, can you share the full error from your log file please?
carlcs
CC BY-SA 3.0
2017-10-15T07:06:13.773Z
@carlcs, amended post to include error log info
Jodi
CC BY-SA 3.0
2017-10-15T07:55:59.287Z
Good job with fixing your issue. Did the stack trace help find the cause, the `setUniqueUri()` and `renderTemplate()`
carlcs
CC BY-SA 3.0
2017-10-15T08:51:08.817Z
Actually no it didn't - I just had a random funny feeling about changing the link structure and tested it out and I was right.
Jodi
<entries>
Can't assign a parent page to an entry
# Can't assign a parent page to an entry

(Asked by: username_0 on 2017-10-13)

I was changing some entry types to allow for a parent/child structure when I realised that this was already something Craft could do natively. When I undid my changes and attempted to assign a parent page, I am given the following error: 

Object of class Craft\Entry Model could not be converted to int.

I am still fairly new to Craft so I am quite limited in understanding exactly what I did to break it. I can still create and edit entries, I just can't set a parent page anymore.
******************************************************************************************************
2017/10/13 22:37:16 [warning] [application] There was a problem parsing the feed: cURL error 60: SSL certificate problem: unable to get local issuer certificate

******************************************************************************************************
2017/10/13 22:37:58 [error] [php] Object of class Craft\EntryModel could not be converted to int (C:\wamp64\www\craft\storage\runtime\compiled_templates\9a\9a68f00c27a5bff3f289231a8d85ef2d821f962bf46e9f246c88cce64dc926f2.php:19)
Stack trace:
#0 C:\wamp64\www\craft\app\etc\templating\BaseTemplate.php(26): __TwigTemplate_22da5c53ac1ef5202e2f12c05417214f2feda1f7c6b451fbb37fa9ade742e5bd->displayWithErrorHandling()
#1 C:\wamp64\www\craft\app\vendor\twig\twig\lib\Twig\Template.php(403): __TwigTemplate_22da5c53ac1ef5202e2f12c05417214f2feda1f7c6b451fbb37fa9ade742e5bd->displayWithErrorHandling()
#2 C:\wamp64\www\craft\app\vendor\twig\twig\lib\Twig\Template.php(411): __TwigTemplate_22da5c53ac1ef5202e2f12c05417214f2feda1f7c6b451fbb37fa9ade742e5bd->display()
#3 C:\wamp64\www\craft\app\services\TemplatesService.php(388): __TwigTemplate_22da5c53ac1ef5202e2f12c05417214f2feda1f7c6b451fbb37fa9ade742e5bd->render()
#4 C:\wamp64\www\craft\app\helpers\ElementHelper.php(122): Craft\TemplatesService->renderObjectTemplate()
#5 C:\wamp64\www\craft\app\services\ElementsService.php(1556): setUniqueUri()
#6 C:\wamp64\www\craft\app\services\EntriesService.php(176): Craft\ElementsService->saveElement()
#7 C:\wamp64\www\craft\app\controllers\EntriesController.php(462): Craft\EntriesService->saveEntry()
#8 C:\wamp64\www\craft\app\framework\web\actions\CInlineAction.php(49): Craft\EntriesController->actionSaveEntry()
#9 C:\wamp64\www\craft\app\framework\web\CController.php(308): CInlineAction->runWithParams()
#10 C:\wamp64\www\craft\app\framework\web\CController.php(286): Craft\EntriesController->runAction()
#11 C:\wamp64\www\craft\app\framework\web\CController.php(265): Craft\EntriesController->runActionWithFilters()
#12 C:\wamp64\www\craft\app\framework\web\CWebApplication.php(282): Craft\EntriesController->run()
#13 C:\wamp64\www\craft\app\etc\web\WebApp.php(823): Craft\WebApp->runController()
#14 C:\wamp64\www\craft\app\etc\web\WebApp.php(287): Craft\WebApp->_processActionRequest()
#15 C:\wamp64\www\craft\app\framework\base\CApplication.php(185): Craft\WebApp->processRequest()
#16 C:\wamp64\www\craft\app\index.php(62): Craft\WebApp->run()
#17 C:\wamp64\www\public_html\index.php(19): require_once()
REQUEST_URI=/public_html/admin/entries/pages/90-cherries

**Tags:** entries

> **Comments:**
> **username_1**: Do you get this error in the Craft control panel?  
> **username_2**: What kind of section did you initially create: channel?  
> **username_0**: I made the items as the type 'Structure'. The error is thrown when I click the 'Save' button. I can edit the page's other fields etc and click 'Save' successfully, but when I add the parent page, and then Save, that is when the error is thrown.  
> **username_1**: So an error in the CP, can you share the full error from your log file please?  
> **username_0**: @username_1, amended post to include error log info  
> **username_1**: Good job with fixing your issue. Did the stack trace help find the cause, the `setUniqueUri()` and `renderTemplate()`  
> **username_0**: Actually no it didn't - I just had a random funny feeling about changing the link structure and tested it out and I was right.  

---

## 1 answers

### Answer by username_0 on 2017-10-15. Score: 2

I was able to fix the issue - it had to do with the URL structure I had set in the Section's URL format area. For nested entries, I had put {parent-uri}/{slug} when in fact it needed to be {parent.uri}/{slug}.

I can now assign parents to entries and this is reflected in the URLs on the front end.


---

