Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5b9fdd2

Browse files
Reduce common control flows
1 parent058d78b commit5b9fdd2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎Form.php‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,16 +421,14 @@ private function initialize(): void
421421
$formId = Crawler::xpathLiteral($this->node->getAttribute('id'));
422422

423423
$fieldNodes =$xpath->query(\sprintf('( descendant::input[@form=%s] | descendant::button[@form=%1$s] | descendant::textarea[@form=%1$s] | descendant::select[@form=%1$s] | //form[@id=%1$s]//input[not(@form)] | //form[@id=%1$s]//button[not(@form)] | //form[@id=%1$s]//textarea[not(@form)] | //form[@id=%1$s]//select[not(@form)] )[( not(ancestor::template) or ancestor::turbo-stream )]',$formId));
424-
foreach ($fieldNodesas$node) {
425-
$this->addField($node);
426-
}
427424
}else {
428425
// do the xpath query with $this->node as the context node, to only find descendant elements
429426
// however, descendant elements with form attribute are not part of this form
430427
$fieldNodes =$xpath->query('( descendant::input[not(@form)] | descendant::button[not(@form)] | descendant::textarea[not(@form)] | descendant::select[not(@form)] )[( not(ancestor::template) or ancestor::turbo-stream )]',$this->node);
431-
foreach ($fieldNodesas$node) {
432-
$this->addField($node);
433-
}
428+
}
429+
430+
foreach ($fieldNodesas$node) {
431+
$this->addField($node);
434432
}
435433

436434
if ($this->baseHref &&'' !==$this->node->getAttribute('action')) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp