Hello Yoann,

> In using the inherit of doctrine with sfDoctrineGuard plugin, I get this
> error:
>
> Fatal error: Access level to BaseecfdbGuardGroupForm::setupInheritance()
> must be public (as in class PluginsfGuardGroupForm)

I'm having the exact same problem, but I'm also doing the same with
sfGuardUser and it works, so there is hope.

The only difference I could find between sfGuardUser, where it works,
and sfGuardGroup, where it doesn't, is in `plugins/
sfDoctrineGuardPlugin/lib/form/doctrine/
PluginsfGuardGroupForm.class.php`, one can find:

public function setupInheritance()
{
  parent::setupInheritance();
  // ...

whereas `symfony doctrine:build-forms` creates `lib/form/doctrine/
myPlugin/base/BasemyGuardGroupForm.class.php` with:

protected function setupInheritance()

In `plugins/sfDoctrineGuardPlugin/lib/form/doctrine/
PluginsfGuardUserForm.class.php`, there is no `setupInheritance()`
method defined.

The workaround I found just now is to change `setupInheritance()` from
public to protected in `plugins/sfDoctrineGuardPlugin/lib/form/
doctrine/PluginsfGuardGroupForm.class.php`. It seems to solve the
problem and survives rebuilding the model/forms/filters. I don't like
modifying sfDoctrineGuardPlugin, but if it's to correct a bug (it
remains to be seen where the real bug is: maybe this method shouldn't
have been public in the first place, maybe build-forms should have
kept it public in the BasemyGuardGroupForm, or maybe we're just doing
it all wrong), it's OK.

> This the result to a difference in level between the functions by
> inheritance:
>
> abstract class BasemyGuardGroupForm extends sfGuardGroupForm
> {
>   protected function setupInheritance()
>   {
>     parent::setupInheritance();
>
> and
>
> class sfGuardGroupForm extends PluginsfGuardGroupForm
> {
>
> and
>
> abstract class PluginsfGuardGroupForm extends BasesfGuardGroupForm
> {
>   public function setupInheritance()
>   {
>     parent::setupInheritance();
>
> My schema.yml :
>
> myGuardGroup:
>   actAs: [Timestampable]
>   inheritance:
>     extends: sfGuardGroup
>     type:    simple
>
> I think this is a bug... From sfDoctrinePlugin or sfDoctrineGuardPlugin ? Or
> mine ? :)

Olivier

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to