symfony2admingenerator / AvocodeFormExtensionsBundle

(old-legacy) Symfony2 form extensions for Admingenerator project (also working standalone!)
Other
48 stars 31 forks source link

Error: Undefined class constant 'PRE_SUBMIT' in SingleUploadSubscriber #37

Closed Matzz closed 11 years ago

Matzz commented 11 years ago

On Symfony 2.2 I got error: FatalErrorException: Error: Undefined class constant 'PRE_SUBMIT' in xyz/htdocs/vendor/avocode/form-extensions-bundle/Avocode/FormExtensionsBundle/Form/EventListener/SingleUploadSubscriber.php line 22

PRE_SUBMIT const was introduced in symfony 2.3

Matzz commented 11 years ago

I found: New in version 2.3: The events PRE_SUBMIT, SUBMIT and POST_SUBMIT were added in Symfony 2.3. Before, they were named PRE_BIND, BIND and POST_BIND. in docs (http://symfony.com/doc/current/cookbook/form/dynamic_form_modification.html)

ioleo commented 11 years ago

This bundle was created for Admingenerator which first stable release will be for Symfony 2.3. That's why we're also 2.3+ compatible and we don't use the deprecated event names.

Matzz commented 11 years ago

But in composer.json there is requirement for sf 2.2 not 2.3. What is more, admin generator composer.json has also the same requirement. Cant we just set this function as deprecated? Problem is not with that the single upload widget doesn't work. Whole bundle is crashing with fatal error

ioleo commented 11 years ago

@Matzz We could do that, but soon Admingenerator will be locked to >= 2.3 anyways (for its first stable release) and 2.2 branch won't be maintained/supported. Since this bundle's primary goal is to provide forms for Admingenerator project, it will also be only maintained/supported for symfony >= 2.3. After I finish my current job/project I'll be back to Admingenerator and will push the remeaning fixes and tag stable 1.0 (probably this month).

So.. you're gonna have to upgrade to 2.3 anyways sooner or later. I can promise that the stable release (for 2.3) will be maintained/supported as long as symfony2's 2.3 branch will be supported.

Matzz commented 11 years ago

Ok. But I think that you should update composer.json and mention about it in documentation. Currently users may thing that sf2.2 iss supported (accordnig to composer.json) but in fact is not working.

Currently I dont have resources to migrate my apps to sf2.3 so I just switch to my fork for a while. I hope it will work :)

ioleo commented 11 years ago

@Matzz I completely understand your point, but I have not much time which will be just enough to complete and maintain a stable 2.3 compatible release. Why 2.3? Becouse it's LTS.

If you change the event names the fork should work, though I'm not sure if you also don't have to change some use statements (some class names have changed since 2.2 -> 2.3).