Fix: uploaded PDF/DOC/TXT files not displayed in entries single view#1571
Open
saurab018 wants to merge 1 commit into
Open
Fix: uploaded PDF/DOC/TXT files not displayed in entries single view#1571saurab018 wants to merge 1 commit into
saurab018 wants to merge 1 commit into
Conversation
- Pass $meta_key as 5th arg to everest_forms_html_field_value filter in entry-single view template so the upload class receives it directly - Accept $field_meta_key as 5th parameter in html_field_value() and increase add_filter accepted_args from 4 to 5 - Use passed meta_key directly in entry-single context instead of fragile array_search() with strict comparison, which silently failed when esc_html() altered the URL string - Add missing continue after setting empty output to prevent string/array type conflict on subsequent loop iterations
1e6b5e3 to
1030f65
Compare
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.
All Submissions:
Changes proposed in this Pull Request:
Fixes a bug where uploaded files (PDF, DOC, TXT, ZIP, etc.) upload successfully and appear in notification emails, but are not visible in the WordPress admin entry single view.
Root cause: The entry-single view template passes
$meta_keyto theeverest_forms_html_field_valuefilter but the filter was registered to accept only 4 arguments, so the meta key was never received by the upload class. Without it,html_field_value()fell back toarray_search( $val, $form_data, true )with strict comparison, which silently returnedfalsewhenesc_html()had altered the file URL — causing all files to be skipped and the field to render blank.$meta_keyas 5th argument toeverest_forms_html_field_valuefilter in the entry-single view templateadd_filteraccepted args from4to5inclass-evf-form-fields-upload.php$field_meta_keyas 5th parameter tohtml_field_value()and use it directly for meta key resolution inentry-singlecontextcontinueafter setting empty$output[$meta_key]to prevent a string/array type conflict on subsequent loop iterationsCloses # .
How to test the changes in this Pull Request:
Types of changes:
Other information:
Changelog entry