patricktalmadge / bootstrapper

Laravel Twitter Bootstrap Bundle
561 stars 129 forks source link

Form alias conflicts with Laravel's #126

Closed syphernl closed 10 years ago

syphernl commented 11 years ago

The Form alias of Bootstrapper is conflicting with Laravel's own, which is causing issues with packages relying on specific aspects only provided by the latter.

Its probably a good idea to rename this to something like BForm or BootstrapperForm to prevent that from happening.

Anahkiasen commented 11 years ago

Well Bootstrapper's Form extends the native one, there is no method that should not work, what problem did you encounter ? Laravel 3 or 4 ?

syphernl commented 11 years ago

Odd. The particular L4 package (ReCaptcha) extends the form and adds a captcha option. When I comment out or rename the Form alias as provided by Bootstrapper it works fine.

It was happening with the latest version of Laravel 4.

greggilbert commented 11 years ago

That recaptcha package is mine. I took a look into it, and it has to do with using Form::macro. Basically, my bundle is using Form::macro() to register its own handler. This bundle's Form.php handles that correctly with the return parent::__callStatic call, but when it comes time to actually call the registered macro, it falls through to the return call_user_func_array('parent::input', $parameters); line. You'd need to get access to the parent form's $macros, but it's protected.

It might make sense to pull over the macros() code into this form. Or something else I'm not thinking of...

PatrickRose commented 10 years ago

This appeared before I really took over so I'm not entirely sure what the status of this is. I'm going to close and will reopen on request.