Sylvio Posted January 12, 2012 Share Posted January 12, 2012 Hello, I have this simple code that throws errors I put in an echo (to test) of the url call on the file (line 5), it throws: /voetvolk.be/site/assets/files/1016/grande_guide_to_lead_nurturing.pdf "Notice: Trying to get property of non-object in ......." Weird thing, the path is outputed as you can see, but I'm getting these errors The $snippet->press_date and $snippet->title are showing up, no problem here The file field press_snippet is a single file field. <?php $press = $pages->get("/press/")->find("press_project=$page->id"); echo "<h3>Press</h3>"; echo "<table>"; foreach($press as $snippet) { echo $snippet->press_snippet->url; ?> <tr> <td><a href='<?=$snippet->press_snippet->url?>' target='_blank'><img src='<?php echo $config->urls->templates?>img/<?=$snippet->press_snippet->ext?>_icon.png' alt='<?=$snippet->press_snippet->get('description|name')?>' title='<?=$snippet->press_snippet->get('description|name')?>' width='24' height='31'/></a></td> <td><?=$snippet->press_date?><br/><?=$snippet->title?></td> </tr> <?php } echo "</table>"; ?> It's probably someting stupid, but I'm not seeing it Thanks S. Link to comment Share on other sites More sharing options...
Adam Kiss Posted January 12, 2012 Share Posted January 12, 2012 I'm 99% sure that some of the objects that you think you have set, in fact you haven't. Could you single out which one of your '$object->property' calls is throwing this one? (It could be that you haven't uploaded press_snippet file, for instance) Link to comment Share on other sites More sharing options...
Sylvio Posted January 12, 2012 Author Share Posted January 12, 2012 adamkiss, Idd, I had two pages of where one didn't had a press_snippet file uploaded Thanks man S. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now