Basic Tutorial Three
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2008 12:59 PM
Hello.
I have alfresco 2.1 installed with php 5.2.5
I am successfully able to view/use the php content templates and have also completed the first two tutorials.
The third tutorial script will display the name, node-dbid, and store-identifier, but on the fourth line (content) of the properties table, I see the following error:
Catchable fatal error: Method ContentData::__toString() must return a string value in C:\wamp\www\test.php on line 95
line 95 of that file is :
<td><?php echo $value ?></td>
why does the value of that property not return a string? any ideas?
I have alfresco 2.1 installed with php 5.2.5
I am successfully able to view/use the php content templates and have also completed the first two tutorials.
The third tutorial script will display the name, node-dbid, and store-identifier, but on the fourth line (content) of the properties table, I see the following error:
Catchable fatal error: Method ContentData::__toString() must return a string value in C:\wamp\www\test.php on line 95
line 95 of that file is :
<td><?php echo $value ?></td>
why does the value of that property not return a string? any ideas?
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2008 10:15 AM
Ok, answering my own question, in case anyone else comes across this…
the ContentData object does not have a __toString method, so in order to access the mimetype/size/etc, you have to access the properties via $value->mimetype, $value->size, etc.
i just modified that line in the test script to be something like
<td><?php
if(is_string($value))
echo $value;
else
echo $value->mimetype;
?></td>
the ContentData object does not have a __toString method, so in order to access the mimetype/size/etc, you have to access the properties via $value->mimetype, $value->size, etc.
i just modified that line in the test script to be something like
<td><?php
if(is_string($value))
echo $value;
else
echo $value->mimetype;
?></td>
