AdvancedCustomFields / AdvancedCustomFields/acf
Filter applied to clone fields
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
When a clone flexible content field is used, the format_value function is called causing an issue due to $value being an array versus a string.
php_1 | NOTICE: PHP message: PHP Fatal error: Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in /var/www/html/wp-includes/shortcodes.php:209
php_1 | Stack trace:
php_1 | #0 /var/www/html/wp-includes/shortcodes.php(209): strpos(Array, '[')
php_1 | #1 /var/www/html/wp-includes/class-wp-embed.php(71): do_shortcode(Array, true)
php_1 | #2 /var/www/html/wp-includes/class-wp-hook.php(303): WP_Embed->run_shortcode(Array)
php_1 | #3 /var/www/html/wp-includes/plugin.php(189): WP_Hook->apply_filters(Array, Array)
php_1 | #4 /var/www/html/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-wysiwyg.php(433): apply_filters('acf_the_content', Array)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at includes/fields/class-acf-field-wysiwyg.php around line 433 and trace the filter call into wp-includes/class-wp-embed.php and wp-includes/shortcodes.php around line 209. Reproduce the problem with a clone flexible content field and determine why an array reaches the shortcode processing path. Done means the fatal TypeError no longer occurs for this field configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend, content
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100