This PR was merged - does not affect released version, merged to the trc
Further inspection of the Automated test output that identified this regression: financial#180
Identifies another issue with dev-master: CiviCRM_API3_Exception: array_key_exists(): The first argument should be either a string or an integer
This test passed with 5.40
OK - I dug into this - the change is the field type changed from BOOLEAN to tinyint (which is more correct) but you are passing TRUE
This is probably less likely to occur outside tests due to the relative rarity of programatically creating membership types - I'm pondering
<field>
<name>auto_renew</name>
<type>tinyint</type>
<default>0</default>
<html>
<type>Radio</type>
<label>Auto-Renew</label>
</html>
<pseudoconstant>
<callback>CRM_Core_SelectValues::memberAutoRenew</callback>
</pseudoconstant>
<comment>0 = No auto-renew option; 1 = Give option, but not required; 2 = Auto-renew required;</comment>
<add>3.3</add>
</field>
Further inspection of the Automated test output that identified this regression: financial#180
Identifies another issue with dev-master: CiviCRM_API3_Exception: array_key_exists(): The first argument should be either a string or an integer
This test passed with 5.40
Thank you @DaveD @seamuslee !
To reproduce:
Result: Fatal Error: PHP Fatal error: Uncaught RuntimeException: The dispatch policy prohibits event "civi.setupui.construct"
2021/07/12 20:57:38 [error] 9381#9381: *47227 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught RuntimeException: The dispatch policy prohibits event "civi.setupui.construct". in /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php:187
Stack trace:
#0 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/setup/src/Setup.php(279): Civi\Core\CiviEventDispatcher->dispatch('civi.setupui.co...', Object(Civi\Setup\UI\Event\UIConstructEvent))
#1 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/includes/civicrm.admin.php(244): Civi\Setup->createController()
#2 /var/aegir/platforms/wordpress/wp-includes/class-wp-hook.php(292): CiviCRM_For_WordPress_Admin->run_installer('')
#3 /var/aegir/platforms/wordpress/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters('', Array)
#4 /var/aegir/platforms/wordpress/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
#5 /var/aegir/platforms/wordpress/wp-admin/admin.php(259): do_action('toplevel_page_c...')
#6 {main}
thrown in /var/aegir/platforms/" while reading upstream, client: 2607:[...], server: test.[...].symbiodev.xyz, request: "GET /wp-admin/admin.php?page=civicrm-install HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "test.[...].symbiodev.xyz", referrer: "https://test.[...].symbiodev.xyz/wp-admin/plugins.php"
Confirmed by @kcristiano
closing as PR has been merged
I agree with @DaveD here so have created https://github.com/civicrm/civicrm-core/pull/20836
Probably round brackets instead of square, but to avoid hurting brain could also be explicit:
self::$instance->dispatcher->setDispatchPolicy([
'/^civi\.setup\./' => 'run',
'/^civi\.setupui\./' => 'run',
'/./' => 'fail'
]);
Or since all setup*
are probably safe, maybe
self::$instance->dispatcher->setDispatchPolicy(['/^civi\.setup.*\./' => 'run', '/./' => 'fail']);
That sounds like a good lead:
setup/src/Setup.php: return $this->getDispatcher()->dispatch('civi.setupui.construct', $event);
so something like?
self::$instance->dispatcher->setDispatchPolicy(['/^civi\.[setup|setupui]\./' => 'run', '/./' => 'fail']);
Or wait there's another namespace civi.setupui (vs civi.setup), so maybe just need to slightly update that regex to allow both civi.setup* and civi.setupui*.
That was added recently with reasoning here: https://github.com/civicrm/civicrm-core/pull/20717#issuecomment-870151022
Short version: prevent non-setup hooks that might call civi stuff before civi is installed.
But it sounds like wordpress uses a wordpress hook to run the installer?
@totten The install setDispatchPolicy
seems to be causing issues, any thought on the above filter?
Commenting out this line works:
https://github.com/civicrm/civicrm-core/blob/master/setup/src/Setup.php#L74
self::$instance->dispatcher->setDispatchPolicy(['/^civi\.setup\./' => 'run', '/./' => 'fail']);
Maybe related to https://github.com/civicrm/civicrm-core/commit/42ccedc7c6bdba553c36462d923f887aeb632e18 ? (no, it's a 2020 old commit)
To reproduce:
Result: Fatal Error: PHP Fatal error: Uncaught RuntimeException: The dispatch policy prohibits event "civi.setupui.construct"
2021/07/12 20:57:38 [error] 9381#9381: *47227 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught RuntimeException: The dispatch policy prohibits event "civi.setupui.construct". in /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php:187
Stack trace:
#0 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/setup/src/Setup.php(279): Civi\Core\CiviEventDispatcher->dispatch('civi.setupui.co...', Object(Civi\Setup\UI\Event\UIConstructEvent))
#1 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/includes/civicrm.admin.php(244): Civi\Setup->createController()
#2 /var/aegir/platforms/wordpress/wp-includes/class-wp-hook.php(292): CiviCRM_For_WordPress_Admin->run_installer('')
#3 /var/aegir/platforms/wordpress/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters('', Array)
#4 /var/aegir/platforms/wordpress/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
#5 /var/aegir/platforms/wordpress/wp-admin/admin.php(259): do_action('toplevel_page_c...')
#6 {main}
thrown in /var/aegir/platforms/" while reading upstream, client: 2607:[...], server: test.[...].symbiodev.xyz, request: "GET /wp-admin/admin.php?page=civicrm-install HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "test.[...].symbiodev.xyz", referrer: "https://test.[...].symbiodev.xyz/wp-admin/plugins.php"
Confirmed by @kcristiano