Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structure bug when attempting to redirect visitor to 3rd party payment processor #2761

Closed
ttmwebdesign opened this issue Jan 16, 2023 · 2 comments · Fixed by #2773
Closed
Assignees
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.

Comments

@ttmwebdesign
Copy link

Description of the problem

EE7.2.5, PHP8.0, CartThrob 7.1.1
After having upgraded CartThrob to 7.1.1 (provided by CT team while working on issues with 3rd party processors), we found that in testing orders, a non-loggedin visitor cannot proceed to the 3rd party payment processor as the site gets hung up on Structure errors. Users logged into the EE CP do not see this issue.

How To Reproduce
Steps to reproduce the behavior:

  1. Add item to cart.
  2. Fill out checkout page.
  3. Submit order button.
  4. Get errors.

If EE developer would like to see this in action, please message me (Niki) in private message on Slack for further details.

Error Messages



Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 71

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 71

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 71

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 71

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 547

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 547

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 71

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 71

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 71

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 71

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 547

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 547

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 71

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 71

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 71

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 71

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 547

Severity: E_WARNING
Warning
Trying to access array offset on value of type null
ee/ExpressionEngine/Addons/structure/tab.structure.php, line 547

Severity: E_WARNING
Warning
Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:120)
ee/legacy/libraries/Functions.php, line 458

Severity: E_WARNING

That is from a 'paid' purchase. The errors are more extensive, but the same ones (over and over) on unpaid orders that get routed to customer service.

Screenshots / Videos / Template Code

Environment Details:

  • Version: EE 7.2.5*
  • PHP Version 8.0
  • MySQL Version 8.x ?
  • OS: Linux I believe? Not sure what 'flavor' though.
  • Web Server: Apache/NGINX combo

Possible Solution

This is what the CartThrob developer changed on line 71 and 547 to suppress/bypass/fix the errors:


LINE 71:
		if(is_null($channel_id)) {
			echo 'fdsa';
			exit;
		}

        $channel_type = $structure_channels[$channel_id]['type'] ?? null;


LINE 547:

$channel_type = $structure_channels[$channel_id]['type'] ?? null;

Additional context

We would like to update to the latest version of EE due to the high level recommendation, but we would need to re-do the above fix for it and every future update unless an EE approved patch is applied in one of the upcoming updates instead.

@ttmwebdesign
Copy link
Author

I am presuming the most important part of the fix is probably the addition of ' ?? null' after the original line, and that the first part of line 71 was just the dev doing some testing since it is echoing a nonsensical thing but didn't remove it afterward.

@matthewjohns0n matthewjohns0n added the Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on. label Jan 19, 2023
@matthewjohns0n matthewjohns0n added this to the 7.2.x milestone Jan 19, 2023
@matthewjohns0n
Copy link
Member

matthewjohns0n commented Jan 19, 2023

Thanks for reporting this @ttmwebdesign. This definitely looks like a bug. This is most likely due to the structure tab file being loaded when Cartthrob loads. Either way, we'll get this one fixed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.
Projects
None yet
4 participants