fix: skip hidden conditional fields during submission#2926
Closed
RabbiIslamRony wants to merge 1 commit into
Closed
fix: skip hidden conditional fields during submission#2926RabbiIslamRony wants to merge 1 commit into
RabbiIslamRony wants to merge 1 commit into
Conversation
RabbiIslamRony
force-pushed
the
fix/hidden-required-conditional-fields
branch
from
July 16, 2026 05:05
f559e7c to
4e00bb4
Compare
Member
Author
|
Replaced by #2927 from RabbiIslamRony:fix/hidden-required-conditional-fields so the PR branch is separated from the main repository remote. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
What kind of change does this PR introduce?
Description
Fixes a listing submission validation issue where required fields hidden by conditional logic were still validated on the backend.
Directorist version
Reported from support on Directorist Core 8.8.3.
Environment
https://directorist-core.local/Issue
When a listing submission form has required fields controlled by conditional logic, a hidden required field can block submission.
Example:
Root cause
The frontend conditional logic hides fields and disables their inputs, so hidden field values are not submitted by the browser. The backend submission validators still looped through every configured form field and applied required validation without evaluating whether the field should be visible for the submitted values.
Fix
Directorist\AddListingForm\SubmissionControllerATBDP_Add_Listingatbdp_add_listing_form_validation_logicfilter behavior.How to reproduce
How to test the changes
SubmissionController::submit()path and the legacy AJAX add-listing path use the same conditional visibility skip.Validation performed
php -l includes/fields/class-directorist-conditional-logic.phpphp -l includes/fields/init.phpphp -l includes/classes/class-submission-controller.phpphp -l includes/classes/class-add-listing.phpgit diff --checkaction: hideconditional logic.Note:
composer phpcscould not be completed in this workspace becausevendor/bin/phpcsis not installed.Any linked issues
Fixes #
Checklist