New Dynamic YouTube Gallery - Embed YouTube Playlist, Channel, Live Stream in minutes. Read More

Problem with Joomla4/PHP8

  • Micha Boschke
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0

Problem with Joomla4/PHP8 was created by Micha Boschke

Hello,
I migrate my site to Joomla 4 and upgrade the PHP-Version to 8.1.7. Now I get an errormessage, when I open the list of videos in the backend:
count(): Argument #1 ($value) must be of type Countable|array, bool given
I know this error from other extensions, they also not PHP8-ready. There I had to change some php-files. I searched for the string "if (@count ($xxx))" and change them to "if (@count(array($xxx)))". Should this solution also works with your extension? I found such strings in "script.allvideoshare.php", but it doesn't work.
Can you help me to make your extension usable und PHP8?
Thanks
Micha Boschke
1 year 9 months ago #9993

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

  • Posts: 2478
  • Thank you received: 1451

Replied by Administrator on topic Problem with Joomla4/PHP8

Kindly share with us the full error message you have received. If possible, kindly send us your site admin access details here allvideoshare.mrvinoth.com/#contact-us to apply the patch on our own.
1 year 9 months ago #9994

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

  • Micha Boschke
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0

Replied by Micha Boschke on topic Problem with Joomla4/PHP8

This is the full error message. If I click on "Komponenten -> All Video Share -> Videos" I get in the main aria the message:

Es ist ein Fehler aufgetreten
0 count(): Argument #1 ($value) must be of type Countable|array, bool given
Zurück zum Dashboard

Categories are working
1 year 9 months ago #9995

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

  • Posts: 2478
  • Thank you received: 1451

Replied by Administrator on topic Problem with Joomla4/PHP8

1. Kindly open the following file,
{SITE_ROOT}/administrator/components/com_allvideoshare/src/Video/Videos/HtmlView.php
2. Find all the lines that use the PHP "count" function and prefix them with an "@" operator (Example: @count).

Save the changes and check now. Hope this solved your issue!
Last edit: 1 year 9 months ago by Administrator.
1 year 9 months ago #9997

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

  • Micha Boschke
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0

Replied by Micha Boschke on topic Problem with Joomla4/PHP8

Thanks - your solution don't work, but with that I found the solution:
in wwwroot\...\administrator\components\com_allvideoshare\src\View\Videos
I change the file HtmlView.php on Line 58
from    if ( ! count( $this->items ) && $this->get( 'IsEmptyState' ) ) {     in      if ( ! count(array( $this->items )) && $this->get( 'IsEmptyState' ) ) {
Now, this errormessage don't appear - but  unfortunately another:
Es ist ein Fehler aufgetreten.
    0 Unknown column 'a.catid' in 'on clause' Unknown column 'a.catid' in 'on clause'
This message I also get in the FrondEnd.
1 year 9 months ago #9998

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

  • Posts: 2478
  • Thank you received: 1451

Replied by Administrator on topic Problem with Joomla4/PHP8

We will send you a patch for PHP 8.1.7 in 24 hrs. Kindly be patient.
1 year 9 months ago #9999

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

Time to create page: 0.099 seconds

We accept cookies to provide you the best viewing experience. By using our services, you agree to our use of cookies