Symfony: sfAssetsLibraryPlugin – troubleshooting

July 28, 2008

Right, so I have this scenario:

I exclude propel.ini from my sync’s with our web server. So after installing a few things i forgot to make the corresponding change online:

* Enable Propel behavior support in propel.ini:

propel.builder.AddBehaviors = true

So when running this (while installing sfAssetsLibraryPlugin):

symfony sfassetlibrary-create-root backend

I would get the following bastard of an error:

Creating root node at media…
PHP Fatal error:  Call to undefined method sfAssetFolder::makeRoot() in /var/www/xxxx/plugins/sfAssetsLibraryPlugin/lib/model/sfAssetFolderPeer.php on line 36

Fatal error: Call to undefined method sfAssetFolder::makeRoot() in /var/www/xxxx/plugins/sfAssetsLibraryPlugin/lib/model/sfAssetFolderPeer.php on line 36

EXTRA NOTE: I also had to add this line at the end of the create function in sfAsset.php:

chmod($this->getFolderPath().”/”. $this->getFilename(), 0604);

This has something to do with the way dreamhost has permission setup and the above create root line.

(The error here was that you could not see the images once uploaded)

9 Responses to “Symfony: sfAssetsLibraryPlugin – troubleshooting”

  1. cutups Says:

    did you ever fix the initial error you describe here? i’m running into the same issue.

  2. rekarnar Says:

    umm not sure, just got back into the country and work mode.

    before i look into it, have you managed to solve this?

  3. ohmnifarious Says:

    i’m having the following error when i try to run symfony sfassetlibrary-create-root backend:

    Fatal error: Class ‘sfAssetFolderPeer’ not found in /Users/jonathanwilliams/Projects/scms/plugins/sfAssetsLibraryPlugin/lib/model/sfAssetFolder.php on line 378

    any ideas?

  4. rekarnar Says:

    yer man. build all and then cc.

  5. ohmnifarious Says:

    rekarnar,

    I have executed propel-build-all and cc, but still getting the error.

    I’ve also verified that the autoload config is set to all the correct paths for sfAssetFolderPeer.php class.

    Even if I manually add a line, “require_once ‘sfAssetFolderPeer.php’ I still get the error.

    What could possibly be the problem?

    Symfony 1.0.12 and php 5.2.0

    Thanks!

  6. rekarnar Says:

    hrm… well first off 1.0.12 is way over a year old! your best bet would be to upgrade that first. 1.0.20 is around now and its been almost only bug fixes in the updates.

    give that a shot first.

  7. ohmnifarious Says:

    Thanks for the suggestion, rekarnar. I reappy appreciate it.

    Just upgraded to 1.0.20 but still getting the Peer Class not found error.

    The crazy thing is that I was able to install sfAssetsLibraryPlugin just fine to a different project running on same Symfony and PHP versions.

    I’m completely at a dead-end trying to figure out how/why PHP claims that the Peer Class doesn’t exist when it clearly does.

  8. rekarnar Says:

    the lib folders are only parsed once, the first time, after the cache is cleared. The file may well be there and symfony wouldn’t know about it. thats why i suggested the cc it above.

    .. but since that didn’t work, and you can confirm its existence.. ummmm try a fix-perms!

    failing that. i have no idea. good luck tho. (or maby just upgrade to 1.2, its soooo lovely!!)

  9. ohmnifarious Says:

    rekarnar,

    i finally figured it out.

    all i had to do was pull out the sfPropelBehavior::add . . . code from sfAssetFolder.php and place it in sfAsetFolderPeer.php.

    thanks for all your help!


Leave a comment