Keyword

Problems with php 7.3

  • Franz Heine
  • Franz Heine's Avatar Topic Author
  • Offline
  • Premium Member
More
11 months 5 days ago #173109 by Franz Heine
Problems with php 7.3 was created by Franz Heine
with php 7.3 i get this error:

Warning: Use of undefined constant com_k2 - assumed 'com_k2' (this will throw an Error in a future version of PHP) in /www/htdocs/w0154391/projekt-rechnung/templates/yoo_stage/layouts/theme.php on line 125

Warning: Use of undefined constant itemlist - assumed 'itemlist' (this will throw an Error in a future version of PHP) in /www/htdocs/w0154391/projekt-rechnung/templates/yoo_stage/layouts/theme.php on line 125

This is my code in the template:


<?php if ($this->count('main-topkategorie') && JRequest::getCmd( 'option' )==com_k2 && JRequest::getCmd( 'view' )==itemlist) : ?>


The reason is, i just want to show this module pos. in the itemlist view.

With php 7.1 is everything fine.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
11 months 5 days ago #173113 by Fotis
Replied by Fotis on topic Problems with php 7.3
You need to slightly modify your code and include some quotes, like this:
<?php if ($this->count('main-topkategorie') && JRequest::getCmd( 'option' )=='com_k2' && JRequest::getCmd( 'view' )=='itemlist') : ?>

(I just added the missing single quotes around com_k2 and itemlist)

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Franz Heine
  • Franz Heine's Avatar Topic Author
  • Offline
  • Premium Member
More
11 months 5 days ago - 11 months 5 days ago #173114 by Franz Heine
Replied by Franz Heine on topic Problems with php 7.3
Thx @Fotis. Worked!


Now i received another issue:

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 14 in /www/htdocs/w0154391/projekt-rechnung/components/com_k2/views/item/view.html.php on line 212

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /www/htdocs/w0154391/projekt-rechnung/components/com_k2/views/item/view.html.php on line 213

Thats the code:
$comments[$i]->commentText = preg_replace("/([\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/i", "<a target=\"_blank\" rel=\"nofollow\" href=\"$1\">$1</A>", $comments[$i]->commentText);
$comments[$i]->commentText = preg_replace("/([\w-?&;#~=\.\/]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?))/i", "<a href=\"mailto:$1\">$1", $comments[$i]->commentText);

Hope youve a solution for thi too.

EDIT: If i comment this area out (#), the notice disappear!!!
Last edit: 11 months 5 days ago by Franz Heine.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
11 months 3 days ago #173117 by Fotis
Replied by Fotis on topic Problems with php 7.3
The regular expressions to filter URLs in comments need some updating because how PHP parses these regular expressions was changed in 7.3 (to be stricter). The range error refers to "w-?". I'll make sure to update that in K2 v2.10 coming this month.

In the meantime, I would recommend setting Joomla's error reporting to none (in Global Configuration).

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Franz Heine
  • Franz Heine's Avatar Topic Author
  • Offline
  • Premium Member
More
11 months 2 days ago #173129 by Franz Heine
Replied by Franz Heine on topic Problems with php 7.3
Great!

When you want to create a new item, i receive this error:

Warning: sizeof(): Parameter must be an array or an object that implements Countable in /www/htdocs/w0154391/projekt-rechnung/administrator/components/com_k2/views/item/view.html.php on line 442

Hope its in your update too

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
11 months 1 day ago #173131 by Fotis
Replied by Fotis on topic Problems with php 7.3
Install K2 v2.10 (dev) from github.com/getk2/k2/archive/master.zip and it should resolve most of these warnings. Of course, if you see any other warning with 2.10 on, do let me know.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Franz Heine
  • Franz Heine's Avatar Topic Author
  • Offline
  • Premium Member
More
11 months 1 day ago #173134 by Franz Heine
Replied by Franz Heine on topic Problems with php 7.3
Thx Fotis,

youre doing a great job! If i see other warnings, ill let you know.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
11 months 1 day ago #173135 by Fotis
Replied by Fotis on topic Problems with php 7.3
Thank you Franz :)

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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


Powered by Kunena Forum