Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

InnerBrowser fillField throws exception if input does not have a name attribute

Offen
#24 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
php, symfony
Bereich
testing

Rechercherichtung

Beginnen Sie in src/Codeception/Lib/InnerBrowser.php ungefähr bei Zeile 789 und untersuchen Sie anschließend Symfony DomCrawler Form.php ungefähr bei Zeile 452 sowie den Aufruf von matchFormField. Reproduzieren Sie fillField mit einem Formularfeld, dessen Name fehlt oder leer ist, und betrachten Sie das Problem als erledigt, sobald es nicht mehr "Malformed field path" auslöst.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

This issue comes from the problem reported in Codeception/Codeception#1221. You will get an exception with the text InvalidArgumentException: Malformed field path "" if you call fillField for a form field without a name attribute or an empty name attribute.

This comes from the fact that the call to matchFormField at https://github.com/Codeception/Codeception/blob/2.1/src/Codeception/Lib/InnerBrowser.php#L789 uses the value of the name attribute to access the fields in a \Symfony\Component\DomCrawler\Form object.

However, this Form object will not store form fields that do not have a value for their name attribute, see this line of code: https://github.com/symfony/dom-crawler/blob/master/Form.php#L452.

I don't see an easy workaround for this problem, but maybe someone else does, maybe @Naktibalda or @DavertMik? I am not really familiar with this part of the Codeception codebase :)

Vorherrschende Sprache
PHP
Sterne
87
Forks
20
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Codeception/lib-innerbrowser

Alle Issues in Codeception/lib-innerbrowser

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.