Ah, no I meant the error disappeared but the ImageID still doesn't get recorded.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
- Previous 10 entries
- 1
- Page 22(current)
Tried the setComponent thing, this is what I got:
[User Warning] DataObject::get_by_id passed a non-numeric ID #4602
POST /Account/addPhotos
Line 2924 in /var/www/vhosts/domain.com/httpdocs/sapphire/core/model/DataObject.php
Source
2915 $tableClasses = ClassInfo::dataClassesFor($callerClass);
2916 $baseClass = array_shift($tableClasses);
2917 return DataObject::get_one($callerClass,"\"$baseClass\".\"ID\" = $id", $cache);
2918
2919 // This simpler code will be used by non-DataObject classes that implement DataObjectInterface
2920 } else {
2921 return DataObject::get_one($callerClass,"\"ID\" = $id", $cache);
2922 }
2923 } else {
2924 user_error("DataObject::get_by_id passed a non-numeric ID #$id", E_USER_WARNING);
2925 }
2926 }
2927
2928 /**
2929 * Get the name of the base table for this object
2930 */
Trace
* DataObject::get_by_id passed a non-numeric ID #<!-- <span style='color:green'>FFMPEG is installed on your server and working properly. Code: 1</span> -->4602
Line 2924 of DataObject.php
* DataObject::get_by_id(Image,<!-- <span style='color:green'>FFMPEG is installed on your server and working properly. Code: 1</span> -->4602)
Line 464 of Account.php
* Account->addPhotos(SS_HTTPRequest)
Line 193 of Controller.php
* Controller->handleAction(SS_HTTPRequest)
Line 137 of RequestHandler.php
* RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 199 of ContentController.php
* ContentController->handleRequest(SS_HTTPRequest)
Line 281 of Director.php
* Director::handleRequest(SS_HTTPRequest,Session)
Line 124 of Director.php
* Director::direct(/Account/addPhotos)
Line 127 of main.php
Why would it be saying it's a non-numeric ID? I don't see anything wrong with the ID number.
You don't see...
<!-- <span style='color:green'>FFMPEG is installed on your server and working properly. Code: 1</span> -->4602
...as a non-numeric ID?
this is the good part...
4602
this is the bad part...
<!-- <span style='color:green'>FFMPEG is installed on your server and working properly. Code: 1</span> -->
Yeah, I saw that. I have no idea why that's showing up or even where it's coming from. If I echo the ID, all I see is the number, not that extra code.
I'd guess that since all the rest of the code is in html comments it would not display. can you use strip_tags on the "id" before passing it into a dataobject get? (maybe also cast it as an int, Convert::raw2xml() or check is_numeric() first)
Even with Convert::raw2xml and checking it by is_numeric, and using strip_tags, it still trips up.
The field is cast as integer, so that wouldn't be it.
It seems like some ffmpeg test code is getting passed somehow in the middle of the process. Thing is, I don't have ffmpeg testing enabled at all.
Found the problem! I decided to look into the DOM's config file and I found this at the bottom of it:
echo "<!-- "; FLV::echo_ffmpeg_test(); echo " -->";
God, what a pain in the ass that was. Does anybody know why this is there? I certainly didn't put it there, in fact it was a pretty fresh copy of the DOM. UncleCheese might want to remove that little bastard next time before uploading a new DOM revision.
Update: Checked out the latest revision of the DOM, this particular code isn't in there anymore.
- Previous 10 entries
- 1
- Page 22(current)