eventespresso / eea-attendee-mover

Addon for EE4+
GNU General Public License v2.0
0 stars 2 forks source link

Replace Legacy Request #17

Closed tn3rb closed 2 years ago

tn3rb commented 3 years ago

closes #16

this PR replaces the legacy EE_Request object with its successor

harshadeventespresso commented 3 years ago

Tested using master branch on both EE4 core and Attendee mover add-on replace-legacy-request

It works with Master branch and Attendee mover add-on replace-legacy-request: https://prnt.sc/1x3dqw4

Then tested with https://github.com/eventespresso/event-espresso-core/pull/3572 and Attendee mover add-on replace-legacy-request it still throws Fatal error: https://prnt.sc/1x3cmy1

Pebblo commented 3 years ago

Confirmed the issue @harshadeventespresso reported.

EE4 core - Master Attendee mover - replace-legacy-request

Works great, no errors.


EE4 core - ease-off-request-interface Attendee mover - replace-legacy-request

Attempting to move an attendee throws:

Fatal error: Uncaught Error: Call to a member function getRequestParam() on boolean in C:\laragon\www\ee4\wp-content\plugins\event-espresso-core-reg\core\libraries\form_sections\form_handlers\SequentialStepFormManager.php on line 213
--

1 | 0.0006 | 466752 | {main}( ) | ...\admin.php:0
2 | 1.2706 | 55680608 | do_action( ) | ...\admin.php:237
3 | 1.2706 | 55680984 | WP_Hook->do_action( ) | ...\plugin.php:470
4 | 1.2706 | 55680984 | WP_Hook->apply_filters( ) | ...\class-wp-hook.php:327
5 | 1.2706 | 55682000 | Extend_Registrations_Admin_Page->load_page_dependencies( ) | ...\class-wp-hook.php:303
6 | 1.2706 | 55682000 | Extend_Registrations_Admin_Page->_load_page_dependencies( ) | ...\EE_Admin_Page_CPT.core.php:323
7 | 1.2706 | 55682000 | Extend_Registrations_Admin_Page->_load_page_dependencies( ) | ...\EE_Admin_Page_CPT.core.php:339
8 | 1.2709 | 55698896 | do_action( ) | ...\EE_Admin_Page.core.php:767
9 | 1.2709 | 55699272 | WP_Hook->do_action( ) | ...\plugin.php:470
10 | 1.2709 | 55699272 | WP_Hook->apply_filters( ) | ...\class-wp-hook.php:327
11 | 1.2709 | 55700288 | EED_Attendee_Mover::edit_attendee_selections_init( ) | ...\class-wp-hook.php:303
12 | 1.2711 | 55700464 | EED_Attendee_Mover->_edit_attendee_selections_init( ) | ...\EED_Attendee_Mover.module.php:424
13 | 1.2760 | 55926344 | EventEspresso\AttendeeMover\form\StepsManager->buildForm( ) | ...\EED_Attendee_Mover.module.php:438
14 | 1.2760 | 55926344 | EventEspresso\AttendeeMover\form\StepsManager->buildCurrentStepFormForDisplay( ) | ...\SequentialStepFormManager.php:395
15 | 1.2760 | 55926344 | EventEspresso\AttendeeMover\form\StepsManager->buildCurrentStepForm( ) | ...\SequentialStepFormManager.php:427
16 | 1.2822 | 56108144 | EventEspresso\AttendeeMover\form\StepsManager->setCurrentStepFromRequest( ) | ...\SequentialStepFormManager.php:466

EE4 Core - 4.10.13.p (current release version) Attendee mover - replace-legacy-request

Fatal error: Uncaught TypeError: Argument 6 passed to EventEspresso\core\libraries\form_sections\form_handlers\SequentialStepFormManager::__construct() must be an instance of EE_Request, instance of EventEspresso\core\services\request\Request given, called in C:\laragon\www\ee4\wp-content\plugins\eea-attendee-mover\form\StepsManager.php on line 57 and defined in C:\laragon\www\ee4\wp-content\plugins\event-espresso-core-reg\core\libraries\form_sections\form_handlers\SequentialStepFormManager.php on line 104
( ! ) TypeError: Argument 6 passed to EventEspresso\core\libraries\form_sections\form_handlers\SequentialStepFormManager::__construct() must be an instance of EE_Request, instance of EventEspresso\core\services\request\Request given, called in C:\laragon\www\ee4\wp-content\plugins\eea-attendee-mover\form\StepsManager.php on line 57 in C:\laragon\www\ee4\wp-content\plugins\event-espresso-core-reg\core\libraries\form_sections\form_handlers\SequentialStepFormManager.php on line 104
Call Stack
#   Time    Memory  Function    Location
1   0.0007  466752  {main}( )   ...\admin.php:0
2   1.2829  55650816    do_action( )    ...\admin.php:237
3   1.2829  55651192    WP_Hook->do_action( )   ...\plugin.php:470
4   1.2829  55651192    WP_Hook->apply_filters( )   ...\class-wp-hook.php:327
5   1.2829  55652208    Extend_Registrations_Admin_Page->load_page_dependencies( )  ...\class-wp-hook.php:303
6   1.2829  55652208    Extend_Registrations_Admin_Page->_load_page_dependencies( ) ...\EE_Admin_Page_CPT.core.php:327
7   1.2829  55652208    Extend_Registrations_Admin_Page->_load_page_dependencies( ) ...\EE_Admin_Page_CPT.core.php:344
8   1.2833  55669104    do_action( )    ...\EE_Admin_Page.core.php:730
9   1.2833  55669480    WP_Hook->do_action( )   ...\plugin.php:470
10  1.2833  55669480    WP_Hook->apply_filters( )   ...\class-wp-hook.php:327
11  1.2833  55670496    EED_Attendee_Mover::edit_attendee_selections_init( )    ...\class-wp-hook.php:303
12  1.2834  55670672    EED_Attendee_Mover->_edit_attendee_selections_init( )   ...\EED_Attendee_Mover.module.php:424
13  1.2834  55670672    EED_Attendee_Mover->get_form_steps_manager( )   ...\EED_Attendee_Mover.module.php:437
14  1.2840  55671376    EventEspresso\core\services\loaders\Loader->getShared( )    ...\EED_Attendee_Mover.module.php:411
15  1.2840  55671376    EventEspresso\core\services\loaders\Loader->load( ) ...\Loader.php:105
16  1.2851  55747592    EventEspresso\core\services\loaders\CachingLoader->load( )  ...\Loader.php:82
17  1.2855  55747704    EventEspresso\core\services\loaders\CoreLoader->load( ) ...\CachingLoader.php:147
18  1.2855  55748080    EE_Registry->create( )  ...\CoreLoader.php:116
19  1.2858  55748192    EE_Registry->_create_object( )  ...\EE_Registry.core.php:773
20  1.2871  55888624    newInstanceArgs ( ) ...\EE_Registry.core.php:1262
21  1.2871  55889040    EventEspresso\AttendeeMover\form\StepsManager->__construct( )   ...\EE_Registry.core.php:1262
22  1.2871  55889040    EventEspresso\AttendeeMover\form\StepsManager->__construct( )   ...\StepsManager.php:57

Notes

If changing this within the add-on means we need to bump the min required version for this version then is it possible to avoid that at all?

tn3rb commented 3 years ago

sorry @Pebblo i made a dum dum mistake in https://github.com/eventespresso/event-espresso-core/pull/3572 but have pushed a fix, should work fine now

tn3rb commented 3 years ago

If changing this within the add-on means we need to bump the min required version for this version then is it possible to avoid that at all?

the change made in https://github.com/eventespresso/event-espresso-core/pull/3572 will allow any currently released versions of the attendee mover, as well as this newer version to work, but the change in this branch is not compatible with versions of EE core lower than 4.10.14.p, so thnx for reminding me to bump the min core version required.

Now that said, this branch is not actually required to fix the issue reported in #16 (i've updated my original post to indicate that this change merely closes #16) as it is the change in https://github.com/eventespresso/event-espresso-core/pull/3572 that fixes this problem. I hope that makes sense.

The change in this PR is an improvement and removes the deprecated EE_Request class, but it is NOT required and does not need to be merged and/or released any time soon. So we can just sit on this for the time being but eventually I would want to merge this change.

harshadeventespresso commented 3 years ago

@tn3rb @Pebblo

Seems like issue is now fixed with EE4 core - ease-off-request-interface Attendee mover - replace-legacy-request

Attempting to move an attendee works : https://prnt.sc/1xacy9i

tn3rb commented 3 years ago

thnx Harshad

Pebblo commented 2 years ago

@tn3rb the above change fixes https://github.com/eventespresso/event-espresso-core/issues/3656

As it was related to switching over to the new Request class I did it in this branch so I could test it all at once and get it pushed.

Could you review my latest change to this branch, please?