- Posts: 14
COMMUNITY FORUM
Error in user blog menu type and mod_k2_user
- Tom Berjoy
-
Topic Author
- Offline
- New Member
Less
More
2 months 12 hours ago - 2 months 12 hours ago #180732
by Tom Berjoy
Error in user blog menu type and mod_k2_user was created by Tom Berjoy
Hello to the JW team and everyone, testing the latest version of K2 on a test website I have found a problem with the user/s content blog menu type.
Returns the following error (PHP 8.2):
IN_ARRAY(): ARGUMENT #2 ($HAYSTACK) MUST BE OF TYPE ARRAY, NULL GIVEN
With PHP 7.4.23 this problem does not exist.
It happens both with this type of menu and with access to "My page" in mod_k2_user.
Please point me in some direction to be able to solve this, since it is essential for users who publish on the Front End and i need to set PHP 8 as soon as possible
Thank you very much and greetings.
-PHP 8.2
-Joomla 3.10.11
-JoomlaWorks K2 v2.11 Build 20230112
Returns the following error (PHP 8.2):
IN_ARRAY(): ARGUMENT #2 ($HAYSTACK) MUST BE OF TYPE ARRAY, NULL GIVEN
With PHP 7.4.23 this problem does not exist.
It happens both with this type of menu and with access to "My page" in mod_k2_user.
Please point me in some direction to be able to solve this, since it is essential for users who publish on the Front End and i need to set PHP 8 as soon as possible
Thank you very much and greetings.
-PHP 8.2
-Joomla 3.10.11
-JoomlaWorks K2 v2.11 Build 20230112
Last edit: 2 months 12 hours ago by Tom Berjoy .
Please Log in or Create an account to join the conversation.
- Tom Berjoy
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 14
1 month 4 weeks ago #180733
by Tom Berjoy
Replied by Tom Berjoy on topic Error in user blog menu type and mod_k2_user
Hello,
Investigating the origin of this problem, I have detected that the error -already fixed- was due to reasons external to K2, but related to another problem:
When activating the K2 child theme developed by Zoolanders (in collaboration with JoomlaWorks) for integration with YOOtheme Pro, an error "undefined constant JPATH_COMPONENT" is finally displayed.
This is because from the script \templates\yootheme_k2\modules\builder-source-k2\src\K2Helper.php two k2 models are called whose constant is not previously initialized:
require_once JPATH_SITE.'/administrator/components/com_k2/models/extrafield.php';
require_once JPATH_SITE.'/administrator/components/com_k2/models/extrafields.php';
and both K2 kernel models scripts use JTable::addIncludePath(JPATH_COMPONENT.'/tables'); where the error occurs, since by removing said line, the error with PHP8 disappears, but it is evident that doing this, K2 will not work without this line of code.
Although I could fix it myself by replacing the constant with the actual path string in these two php scripts from the heart of k2, I am bringing this to the attention of the JoomlaWorks team in case there is some kind of inconsistency with PHP8. I would appreciate an answer on this.
Thank you very much and greetings.
Investigating the origin of this problem, I have detected that the error -already fixed- was due to reasons external to K2, but related to another problem:
When activating the K2 child theme developed by Zoolanders (in collaboration with JoomlaWorks) for integration with YOOtheme Pro, an error "undefined constant JPATH_COMPONENT" is finally displayed.
This is because from the script \templates\yootheme_k2\modules\builder-source-k2\src\K2Helper.php two k2 models are called whose constant is not previously initialized:
require_once JPATH_SITE.'/administrator/components/com_k2/models/extrafield.php';
require_once JPATH_SITE.'/administrator/components/com_k2/models/extrafields.php';
and both K2 kernel models scripts use JTable::addIncludePath(JPATH_COMPONENT.'/tables'); where the error occurs, since by removing said line, the error with PHP8 disappears, but it is evident that doing this, K2 will not work without this line of code.
Although I could fix it myself by replacing the constant with the actual path string in these two php scripts from the heart of k2, I am bringing this to the attention of the JoomlaWorks team in case there is some kind of inconsistency with PHP8. I would appreciate an answer on this.
Thank you very much and greetings.
Please Log in or Create an account to join the conversation.
- Raymond Shannon
-
- Offline
- New Member
Less
More
- Posts: 1
1 month 2 weeks ago - 1 month 2 weeks ago #180758
by Raymond Shannon
Replied by Raymond Shannon on topic Error in user blog menu type and mod_k2_user
What did you do?
Last edit: 1 month 2 weeks ago by Raymond Shannon.
Please Log in or Create an account to join the conversation.