Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Respect nullified record action and url in tables #15350

Open
wants to merge 2 commits into
base: 3.x
Choose a base branch
from

Conversation

zsnakeee
Copy link

This PR fixes an issue where setting recordAction or recordUrl to null in a table configuration would be overridden by the default values.

Changes

  1. Added tracking of whether recordAction and recordUrl have been explicitly set:

    • Added hasRecordActionBeenSet and hasRecordUrlBeenSet flags
    • Added getter methods to check these flags
  2. Modified table builders to respect user configuration:

    • Only apply default values when the user hasn't set these values explicitly
    • This allows nullification to work properly
  3. Added comprehensive tests:

    • Tests for basic table configuration
    • Tests for relation manager table configuration
    • Tests for both nullification and custom values
    • Tests for closure-based values

Testing

Added a new test file tests/Tables/TableConfigurationTest.php that verifies:

  • Record actions and URLs can be nullified
  • Both settings can be set together
  • Both settings can be nullified together
  • Closure values are properly evaluated
  • RelationManager respects all these settings

Breaking Changes

None. This change fixes a bug where user configuration was being ignored, restoring the expected behavior.

Security Impact

None. This is a purely functional change that does not affect security.

Added tracking of whether recordAction and recordUrl have been explicitly
set by the user. This ensures that default values are only applied when
the user hasn't set these values explicitly, allowing nullification to
work properly.

This fixes an issue where setting recordAction or recordUrl to null in
a table configuration would be overridden by the default values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant