This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » User management plugins » sfGuard and sfPropel13
sfGuard and sfPropel13 [message #38660] Sat, 03 November 2007 12:16 Go to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Hi all

Has anyone any experience with using sfGuard with sfPropel13? I've installed both and built the model with no problems, but loading the fixtures results in an error:

>> propel    load data from "/var/www/corp...ns/sfGuardPlugin/data/fixtures"
PHP Fatal error:  Declaration of sfGuardUser::delete() must be compatible with that of
Persistent::delete() in /var/www/corp/plugins/sfGuardPlugin/lib/model/sfGuardUser.php on line 18

I am considering writing a patch to update sfGuard to what might be called "sfGuardPropel13", but I'm not sure how much work I am taking on. If it's relatively straightforward I'll do it, but not if there's such substantial ResultSet code in there that needs converting to PDO. Any thoughts?


Remember Palestine
Re: sfGuard and sfPropel13 [message #38662 is a reply to message #38660 ] Sat, 03 November 2007 13:15 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
I've had a scan of the code and I am guessing that there's actually not much work to do. I've created these small patches, which ensures that the model correspondents to a base implementation class.

If there are more changes I shall add them to this thread (and anyone else is welcome to add tips if they have any).

[Patch removed, see patch later in thread]

[Updated on: Sat, 03 November 2007 19:25]


Remember Palestine
Re: sfGuard and sfPropel13 [message #38663 is a reply to message #38660 ] Sat, 03 November 2007 13:16 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Another diff file.

[Patch removed, see patch later in thread]

[Updated on: Sat, 03 November 2007 19:25]


Remember Palestine
Re: sfGuard and sfPropel13 [message #38664 is a reply to message #38660 ] Sat, 03 November 2007 13:24 Go to previous messageGo to next message
naholyr  is currently offline naholyr
Messages: 223
Registered: June 2007
Faithful Member
I got some strange errors when I tried to pass to Propel 1.3. Of course there are all the type-casting issues, but they're very easy to correct.
If you try to make it fully working, it would be very nice, but be sure you make all the tests. I can't remember what made me give up I'll try to get it back, but I think it was all around the backend.
Re: sfGuard and sfPropel13 [message #38668 is a reply to message #38660 ] Sat, 03 November 2007 14:58 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Any help you can provide will be appreciated... I'm running into two errors right now.

Firstly, I've modified the generator.yml files for sfGuardUser, sfGuardGroup and sfGuardPermission so that they use the 1.3 admin generator. Now, when a save or update occurs in the admin generator, I'm getting:

Call to undefined method sfUser::setFlash

Also, if the filters key is enabled (eg in sfGuardUser) this throws:

Fatal error: Call to undefined method ColumnMap::getCreoleType() in
/usr/share/php/symfony/generator/sfAdminGenerator.class.php on line 786

This problem can be fixed temporarily by commenting the key out, but it would be nice to fix it properly.


Remember Palestine
Re: sfGuard and sfPropel13 [message #38669 is a reply to message #38660 ] Sat, 03 November 2007 15:03 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Ooh, I think I spoke too soon! First problem is fixed here:

http://trac.symfony-project.com/changeset/5556

It's strange though, this makes it look like the admin generator hasn't worked since symfony 1.0 was released, and I really can't believe that's the case!

Edit: ah, the changeset is to the new admin generator, not the old one. I guess the author must have been working with an old copy of the admin generator code. That makes sense now Smile

[Updated on: Sat, 03 November 2007 15:04]


Remember Palestine
Re: sfGuard and sfPropel13 [message #38670 is a reply to message #38660 ] Sat, 03 November 2007 16:02 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
OK, I've sorted the other problem too. All that was required was to check out the latest version of sfPropel13Plugin from svn, which drags in the latest 1.3 files, and to modify my earlier patching (the class hint on connection parameters was "PDO", is now "PropelPDO").

I'm out of time now but I will add new patch files to this thread later on.

[Updated on: Sat, 03 November 2007 16:03]


Remember Palestine
Re: sfGuard and sfPropel13 [message #38676 is a reply to message #38660 ] Sat, 03 November 2007 19:29 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
I've had a little play, and can find only five little things to tweak to get sfGuard to work with Propel 1.3. This is not thoroughly tested, mind you, but if I run into problems in my current app I will post updates.

Run the following diff in the root of your project, after installing the sfGuard plugin and checking out the latest sfPropel13 code from subversion:

patch -p0 < sfGuardPropel13.patch

Clear your cache and you should be good to go Very Happy


Remember Palestine
Re: sfGuard and sfPropel13 [message #38686 is a reply to message #38660 ] Sat, 03 November 2007 23:08 Go to previous messageGo to next message
naholyr  is currently offline naholyr
Messages: 223
Registered: June 2007
Faithful Member
I'll be testing your patch this week on my current project
Re: sfGuard and sfPropel13 [message #38816 is a reply to message #38660 ] Mon, 05 November 2007 23:23 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Great. Let me know if you run into any problems, and if so we may be able to add improvements to the patch.


Remember Palestine
Re: sfGuard and sfPropel13 [message #51996 is a reply to message #38816 ] Wed, 14 May 2008 17:52 Go to previous messageGo to next message
advicepig  is currently offline advicepig
Messages: 2
Registered: May 2008
Location: Minneapolis, MN
Junior Member
Thanks, that worked pretty well.

I had to make a few changes since it appears that some of the sfGuard code has changed.

In plugins/sfGuardPlugin/lib/model/sfGuardUser.php the class now extends plugins/sfGuardPlugin/lib/model/plugin/PluginsfGuardUser.php so the changes to that first file need to be made to the second file instead.

The same goes for plugins/sfGuardPlugin/lib/model/sfGuardUserGroup.php and plugins/sfGuardPlugin/lib/model/plugin/PluginsfGuardUserGrou p.php

I've never worked with patch files before, but the warnings and rejected files were enough for me to figure out what to change in my own files.

Oh and in case anyone else is wondering, you need to run the patch from the root level of your symfony installation.
Re: sfGuard and sfPropel13 [message #54132 is a reply to message #51996 ] Sun, 15 June 2008 22:31 Go to previous messageGo to next message
ColinFine  is currently offline ColinFine
Messages: 8
Registered: December 2007
Location: Bradford, England
Junior Member

I've hit the same problem, and tried to apply the patch. I got the same problem as advicepig, and tried to apply his/her advice; but it doesn't seem to make sense to me.

As advicepig says, sfGuardUser.php now extends PluginsfGuardUser.

But PluginsfGuardUser appears to extend BasesfGuardUser, and I can't find that anywhere - it doesn't seem to be in the plugin at all.

Is there another plugin that it now depends on or something?

Re: sfGuard and sfPropel13 [message #54152 is a reply to message #38660 ] Mon, 16 June 2008 11:50 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
I haven't upgraded my sfGuard plugin for the project in which I created this patch, though I dare say I will at some point.

Colin, if you are having trouble with the patch, you can always read it in a text editor and apply the changes manually. As per advicepig's approach, once you've figured out what few things need changing, you can generally hack the changes if the patch no longer works cleanly.


Remember Palestine
Re: sfGuard and sfPropel13 [message #56171 is a reply to message #38660 ] Mon, 14 July 2008 22:27 Go to previous messageGo to next message
Amaridian  is currently offline Amaridian
Messages: 10
Registered: July 2008
Location: M√ľnster, Germany
Junior Member

I've modified the Patch for the current version of the sfGuardPlugin. As described above:

halfer

Run the following diff in the root of your project, after installing the sfGuard plugin and checking out the latest sfPropel13 code from subversion:

patch -p0 < sfGuardPropel13.patch

Clear your cache and you should be good to go Very Happy


good luck Wink
Amaridian

Re: sfGuard and sfPropel13 [message #59815 is a reply to message #56171 ] Sat, 30 August 2008 17:33 Go to previous messageGo to next message
inner.glow  is currently offline inner.glow
Messages: 9
Registered: August 2008
Junior Member
The Patch doesn't work for the newest version of the Plugin.

You have to change plugins/sfGuardPlugin/lib/model/plugin/PluginsfGuardUserPerm ission.php as well.

public function save(PropelPDO $con = null)
Re: sfGuard and sfPropel13 [message #59896 is a reply to message #38660 ] Mon, 01 September 2008 12:54 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Yep, the patch was written for the 1.0 version of the plugin.

If there are other things that the latest patch here does not fix, could you release a new patch? Smile


Remember Palestine
Re: sfGuard and sfPropel13 [message #59906 is a reply to message #59896 ] Mon, 01 September 2008 14:52 Go to previous messageGo to next message
inner.glow  is currently offline inner.glow
Messages: 9
Registered: August 2008
Junior Member
Yeah, I could release a new patch...

but I would like to understand these changes made in the last patch:

-  class:              sfPropelAdminGenerator
+  class:              sfPropel13AdminGenerator


... they did not work for me. I had to undo the changes.
Re: sfGuard and sfPropel13 [message #59909 is a reply to message #38660 ] Mon, 01 September 2008 15:11 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
I think I made this change in my original patch. I'm not sure, but I am guessing that the Propel 1.3 plugin contains a new sfPropelAdminGenerator (which is called sfPropel13AdminGenerator). What specifically about this change did not work for you?


Remember Palestine
Re: sfGuard and sfPropel13 [message #59912 is a reply to message #38660 ] Mon, 01 September 2008 15:27 Go to previous message
inner.glow  is currently offline inner.glow
Messages: 9
Registered: August 2008
Junior Member
Symfony did not find the class sfPropel13AdminGenerator although it is contained in ihe Propel 1.3 Plugin. After undoing the changes the modules sfGuardGroup, sfGuardUser and sfGuardPermission worked fine...
Previous Topic:[RESOLVED] sfGuard login and extjs
Next Topic:[SOLVED] Where is the "remember me" checkbox of the sfGuard plugin?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software