Skip to content

Issue 5886 improvements - #3221

Merged
Crabcyborg merged 7 commits into
issue-5886-improve_form_errors_accessibilityfrom
issue_5886_improvements
Aug 5, 2026
Merged

Issue 5886 improvements#3221
Crabcyborg merged 7 commits into
issue-5886-improve_form_errors_accessibilityfrom
issue_5886_improvements

Conversation

@Crabcyborg

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a8e7bff1-e1c8-4e95-8047-cde5fb7444ac

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@deepsource-io

deepsource-io Bot commented Aug 5, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 7fd9665...b28445d on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP Aug 5, 2026 5:51p.m. Review ↗
JavaScript Aug 5, 2026 5:51p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

$invalid_msg .= "<ul>$field_error_messages</ul>";
}

return apply_filters( 'frm_invalid_error_message', $invalid_msg, $args );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function apply_filters invoked with 3 parameters, 2 required


The function call is not valid, which will result in a fatal runtime error.

);

// The base invalid message is wrapped in a span, and the links are inside a list.
$this->assertStringContainsString( '<ul>', $message );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

)
);

$this->assertStringContainsString( '<li><a href="#field_repeated_text-2">Repeated text is required</a></li>', $message );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

* @covers FrmFormsHelper::get_invalid_error_message
*/
public function test_get_invalid_error_message_builds_clickable_field_links() {
$this->form = $this->factory->form->create_and_get();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property test_FrmFormsHelper::$factory


The property you are trying to access is not defined and will cause unexpected behavior when used.


// The base invalid message is wrapped in a span, and the links are inside a list.
$this->assertStringContainsString( '<ul>', $message );
$this->assertStringContainsString( '<li><a href="#field_my_text">Text is required</a></li>', $message );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

* @covers FrmFormsHelper::get_invalid_error_message
*/
public function test_get_invalid_error_message_escapes_output() {
$this->form = $this->factory->form->create_and_get();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property test_FrmFormsHelper::$factory


The property you are trying to access is not defined and will cause unexpected behavior when used.

)
);

$this->assertStringNotContainsString( '<script>alert(1)</script>', $message );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringNotContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

);

$this->assertStringNotContainsString( '<script>alert(1)</script>', $message );
$this->assertStringContainsString( '&lt;script&gt;', $message );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

* @covers FrmFormsHelper::get_invalid_error_message
*/
public function test_get_invalid_error_message_handles_repeater_row_keys() {
$this->form = $this->factory->form->create_and_get();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property test_FrmFormsHelper::$factory


The property you are trying to access is not defined and will cause unexpected behavior when used.

* @return int
*/
private function create_field_with_key( $type, $field_key ) {
return $this->factory->field->create(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property test_FrmFormsHelper::$factory


The property you are trying to access is not defined and will cause unexpected behavior when used.

@deepsource-io

deepsource-io Bot commented Aug 5, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 7fd9665...62490e8 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP Aug 5, 2026 7:15p.m. Review ↗
JavaScript Aug 5, 2026 7:15p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

'class' => 'frm_message',
)
);
$this->assertStringContainsString( 'role="status"', $default );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

'role' => 'alert',
)
);
$this->assertStringContainsString( 'role="alert"', $alert );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

)
);
$this->assertStringContainsString( 'role="alert"', $alert );
$this->assertStringNotContainsString( 'role="status"', $alert );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringNotContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

);

// Scripts are removed entirely.
$this->assertStringNotContainsString( '<script', $message );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringNotContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

// Scripts are removed entirely.
$this->assertStringNotContainsString( '<script', $message );
// Anchors in the message are stripped so they cannot nest inside the summary link.
$this->assertStringNotContainsString( 'https://evil.test', $message );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringNotContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

);

// Hidden and user ID errors appear as plain list items, with no anchor to a non-focusable input.
$this->assertStringContainsString( '<li>Hidden is required</li>', $message );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringContainsString()


The method you are trying to call is not defined, which can result in a fatal error.


// Hidden and user ID errors appear as plain list items, with no anchor to a non-focusable input.
$this->assertStringContainsString( '<li>Hidden is required</li>', $message );
$this->assertStringContainsString( '<li>User ID is required</li>', $message );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

// Hidden and user ID errors appear as plain list items, with no anchor to a non-focusable input.
$this->assertStringContainsString( '<li>Hidden is required</li>', $message );
$this->assertStringContainsString( '<li>User ID is required</li>', $message );
$this->assertStringNotContainsString( '#field_my_hidden', $message );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringNotContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

$this->assertStringContainsString( '<li>Hidden is required</li>', $message );
$this->assertStringContainsString( '<li>User ID is required</li>', $message );
$this->assertStringNotContainsString( '#field_my_hidden', $message );
$this->assertStringNotContainsString( '#field_my_user_id', $message );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmFormsHelper::assertStringNotContainsString()


The method you are trying to call is not defined, which can result in a fatal error.

* @covers FrmFormsHelper::get_success_message
*/
public function test_get_success_message_role() {
$form = $this->factory->form->create_and_get();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property test_FrmFormsHelper::$factory


The property you are trying to access is not defined and will cause unexpected behavior when used.

Comment thread stubs.php
*
* @return bool
*/
public static function field_on_current_page( $field ) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method FrmProFieldsHelper::field_on_current_page() should return bool but return statement is missing


This issue is raised if a method with a return type does not have a return statement of an appropriate type.

@Crabcyborg
Crabcyborg merged commit cae5029 into issue-5886-improve_form_errors_accessibility Aug 5, 2026
16 of 19 checks passed
@Crabcyborg
Crabcyborg deleted the issue_5886_improvements branch August 5, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant