Jump to:

23487 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » [SOLVED] ImageID won't record anymore

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

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

Page: 1 2
Go to End
Author Topic: 2080 Views
  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: [SOLVED] ImageID won't record anymore Link to this post

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

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: [SOLVED] ImageID won't record anymore Link to this post

    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.

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: [SOLVED] ImageID won't record anymore Link to this post

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

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: [SOLVED] ImageID won't record anymore Link to this post

    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.

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: [SOLVED] ImageID won't record anymore Link to this post

    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)

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: [SOLVED] ImageID won't record anymore Link to this post

    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.

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: [SOLVED] ImageID won't record anymore Link to this post

    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.

    2080 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.