Skip to Content Skip to Menu

After updating to PHP8, Redirect Autoactions no longer working

  • boyjahq
  • boyjahq
  • OFFLINE
  • Posts: 473
  • Thanks: 33
  • Karma: 3
1 year 10 months ago - 1 year 10 months ago #331983 by boyjahq
We recently updated to PHP 8 and we find that our previously reliable Redirect Autoactions no longer redirect the user.

We are using Joomla 3.10.11 and PHP 8 and all Community Builder extensions/plugins are updated to the newest stable version.
Last edit: 1 year 10 months ago by boyjahq.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 10 months ago - 1 year 10 months ago #331986 by krileon
8.0? 8.1? 8.2? Minor version is very important. What trigger is your redirect action acting on? Joomla 3 will throw a ton of deprecated warnings on 8.1 so I don't really recommend anything higher than 8.0 for Joomla 3. More than likely something is interrupting the redirect and CB Auto Actions itself isn't erroring.

Community Builder extensions/plugins are updated to the newest stable version.

Install latest build releases for PHP 8.1 compatibility fixes.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 1 year 10 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • boyjahq
  • boyjahq
  • OFFLINE
  • Posts: 473
  • Thanks: 33
  • Karma: 3
1 year 10 months ago - 1 year 10 months ago #332008 by boyjahq
We are using Joomla 3.10.11. We were using PHP 8.1 but have now changed back to PHP 8.0 as per your recommendation. We have updated all Community Builder related extensions and plugins to the most recent latest build releases. 

Redirect autoaction info:

Trigger = OnAfterLogin
User = Automatic
Access = Registered

3 conditions set:
Usergroups - Action User is of the required user group
A specified CB field = 0 for Action User
Languages - 
 From = User
 User = Action User
 Operator = Has
 Languages = English

Output - Display = Return

Parameters:
Reload User = Yes
Translate = Yes
Substitutions = Yes
Format Functions = Yes
Content Plugins = Yes

All of these settings are how it has been working for years until we changed to PHP 8.0. 

We have 2 of these redirects in place. They are identical in settings except that the Languages condition are different: one is for English and the other for Japanese so that users are redirected to the correct language page.
Last edit: 1 year 10 months ago by boyjahq.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 10 months ago #332017 by krileon
Enable debug mode under the parameters tab and retry. That should output to Joomla's message queue if any part of the auto action failed. It will also inform you of failed conditions as it's possible the condition is failing for some reason.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • boyjahq
  • boyjahq
  • OFFLINE
  • Posts: 473
  • Thanks: 33
  • Karma: 3
1 year 10 months ago - 1 year 10 months ago #332047 by boyjahq
I have found something interesting related to this issue. I went through all conditions and changed things like Action User to Viewing User, etc. and then tested. What I found is that the Equal To condition for a field value was causing the problem.

We have a CB field called "cb_profilestatus" and it is an integer field that starts at 0 (zero) and after the form is completed it is set to 1. In all of our failing auto actions that use that condition (but worked for years prior to updating to PHP 8.0), I found that changing  the Operator from "Equal To" and Value = 0 to Operator is "Less Than" and Value = 1, then they all work correctly. Is it possible that there is something wrong with the Equal To operator in the current nightly builds?

Condition cb_profilestatus = 0    No longer works
Condition cb_profilestatus < 1    Works
I also tried Condition cb_profilestatus != 1 (Not Equal To)    and that doesn't work either

Turning on Debug for this auto action, I get the following error:
Error
:: Action 197 :: Condition 1-5 failed for user 58917 with "" Equal To "0"

If I change this to another CB field that I have created that uses integers to determine status of some aspect of the user's membership, for example we have another field that is cb_activemember: 0 until certain processes have been done then it turns to 1. If I use that field as the condition (and login with a user account that does not meet that condition so a debug error is generated), I see this error message:
Error
:: Action 197 :: Condition 1-5 failed for user 58917 with "1" Equal To "0"

As you can see, this last error message contains values in both "" areas, whereas the failing one does not contain a value in the first "" value field.

Then, looking deeper, I went to the comprofiler database table and looked at the structure for this field. I noticed that other int(11) fields in the database  (id, user_id, hits, message_number_sent, etc.) had NULL set to NO and Default set to 0 (zero)

So, I changed Default for my field from NULL to 0...and now it works!

From:
cb_profilestatus  int(11)  Yes  NULL

To:
cb_profilestatus  int(11)  No  0

Might be something to look into on your end?
Last edit: 1 year 10 months ago by boyjahq.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 10 months ago - 1 year 10 months ago #332051 by krileon
Any field can potentially be NULL. NULL means no value was ever stored yet. When dealing with 0 and 1 flags and you want to test against 0 it's always best to use "Not Equal To 1" condition to account for NULL and 0.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 1 year 10 months ago by krileon.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum