Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

[SOLVED] ImageID won't record anymore


Go to End


15 Posts   3144 Views

Avatar
Ryan M.

Community Member, 309 Posts

11 August 2010 at 6:50pm

Ah, no I meant the error disappeared but the ImageID still doesn't get recorded.

Avatar
Ryan M.

Community Member, 309 Posts

29 September 2010 at 12:08am

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.

Avatar
swaiba

Forum Moderator, 1899 Posts

29 September 2010 at 12:12am

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> -->

Avatar
Ryan M.

Community Member, 309 Posts

29 September 2010 at 12:45am

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.

Avatar
swaiba

Forum Moderator, 1899 Posts

29 September 2010 at 12:49am

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)

Avatar
Ryan M.

Community Member, 309 Posts

29 September 2010 at 1:14am

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.

Avatar
Ryan M.

Community Member, 309 Posts

29 September 2010 at 1:24am

Edited: 29/09/2010 1:46am

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.

Go to Top