Skip to content

Support string $upgrade_link_args in FrmAddonsController::conditional_action_button#1406

Merged
Crabcyborg merged 2 commits into
masterfrom
issue_1405
Dec 6, 2023
Merged

Support string $upgrade_link_args in FrmAddonsController::conditional_action_button#1406
Crabcyborg merged 2 commits into
masterfrom
issue_1405

Conversation

@Crabcyborg
Copy link
Copy Markdown
Contributor

@Crabcyborg Crabcyborg commented Dec 6, 2023

Fixes #1405

The welcome page passes views-info for the upgrade link args. The function was setting an array key, which causes issues when the variable isn't an array.

This update sets it to an array. By the time FrmAppHelper::admin_upgrade_link is called, we no longer need the medium value being passed in $upgrade_link_args. If it's a string, it's fine to set it to an empty array.

The next line sets the link as before, now with an array value.

PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /var/www/src/wp-content/plugins/formidable/classes/controllers/FrmAddonsController.php:1260
Stack trace:
#0 /var/www/src/wp-content/plugins/formidable/classes/controllers/FrmWelcomeController.php(175): FrmAddonsController::conditional_action_button('views', 'views-info')
#1 /var/www/src/wp-content/plugins/formidable/classes/views/welcome/show.php(82): FrmWelcomeController::maybe_show_conditional_action_button('views', 'views-info')
#2 /var/www/src/wp-content/plugins/formidable/classes/controllers/FrmWelcomeController.php(102): include('/var/www/src/wp...')
#3 /var/www/src/wp-includes/class-wp-hook.php(324): FrmWelcomeController::screen_content('')
#4 /var/www/src/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#5 /var/www/src/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#6 /var/www/src/wp-admin/admin.php(259): do_action('forms_page_form...')
#7 {main}

@Crabcyborg Crabcyborg added this to the 6.6.1 milestone Dec 6, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 6, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (0b78246) 29.12% compared to head (7e2d849) 29.11%.

Files Patch % Lines
classes/controllers/FrmAddonsController.php 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1406      +/-   ##
============================================
- Coverage     29.12%   29.11%   -0.01%     
- Complexity     7294     7295       +1     
============================================
  Files           105      105              
  Lines         24058    24060       +2     
============================================
  Hits           7006     7006              
- Misses        17052    17054       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Crabcyborg Crabcyborg marked this pull request as ready for review December 6, 2023 20:47
@Crabcyborg Crabcyborg merged commit 33d8eed into master Dec 6, 2023
@Crabcyborg Crabcyborg deleted the issue_1405 branch December 6, 2023 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error with Formidable Forms Plugin on WordPress 6.4.1

1 participant