zendframework / zend-form

Form component from Zend Framework
BSD 3-Clause "New" or "Revised" License
69 stars 87 forks source link

Added tel and search as default plugins #234

Closed Draxticore closed 4 years ago

Draxticore commented 4 years ago

As can be seen in:

57

, the tel and search types have been initially omitted, for whatever reason, and are also still missing as default plugins. My issue has been marked as a bug, and I will treat it as a bug.

Code to reproduce the issue

I have the following config:

    'form' => [
        'elements' => [
            [
                'spec' => [
                    'type' => 'tel',
                    ...
                ],
            ],
        ],
    ],

Current result

Service with name "" could not be created. Reason: A plugin by the name "tel" was not found in the plugin manager Zend\Form\FormElementManager\FormElementManagerV3Polyfill

New result

The tel plugin is now found.

Test

No test provided

michalbundyra commented 4 years ago

Just note: we need to check tests (maybe there is a place where these should be added) and documentation.

Draxticore commented 4 years ago

I looked through the testcode, and did not explicitly find similar tests. In test/FormElementManagerFactoryTest.php there are 2 references to the config 'form_elements', but this seem to be of a general nature. Of course, from a regression perspective, I guess that perhaps there should be tests for all commits. I am not experienced with writing these tests, but given time, I could probably come up with something. I went through the genereic zend-form documentation, and the specific tel and search parts, I did not find reason to update it. Also, while reading: https://docs.zendframework.com/zend-form/element/tel/ , I realized that what I fixed in my case, was really making a default alias, not a default plugin. So my initial title is off, but the fix is valid. Let me know your opinion about tests and documentation.

michalbundyra commented 4 years ago

Resolves #233.

michalbundyra commented 4 years ago

Thanks, @Draxticore!