joomla-extensions / weblinks

This repo is meant to hold the decoupled com_weblinks component and related code.
GNU General Public License v2.0
45 stars 88 forks source link

PHP 8 errors #429

Closed HLeithner closed 3 years ago

HLeithner commented 4 years ago

Errors are: 0 count(): Argument #1 ($var) must be of type Countable|array, null given /components/com_weblinks/models/categories.php:95

0 Attempt to modify property "params" on null /components/com_weblinks/views/category/tmpl/default_items.php:17

bayareajenn commented 4 years ago

So...

  1. Weblinks won't install from the Install from Web tab in com_installer in PHP8. It will install from package file.

  2. Create category. Then create some weblinks.

  3. Create Menu Items for any type of Weblinks menu item type and they throw the errors Harald mentioned above.

alikon commented 4 years ago

i can confirm

Weblinks won't install from the Install from Web tab in com_installer in PHP8. It will install from package file.

nor from install from URL

with Error Unable to detect manifest file.

HLeithner commented 4 years ago

does other extensions work? I test 2 other extensions without problems so I'm not sure if it's weblinks or joomla

alikon commented 4 years ago

i've installed Akeeba Backup Core 7.4.0.1 (2020-11-18), and despite

PHP version 8.0 is newer than this software supports

seems to work

bayareajenn commented 4 years ago

I installed two other extensions (Akeeba and JCE) via the Install from Web tab without issues. I agree with @alikon that I too got the message with Akeeba that 8.0 is newer than the software supports. JCE installs and displays but some functionality doesn't work presumably because it isn't ready for 8.

So I think the issue is with Weblinks and not with Install from Web.

ChristineWk commented 3 years ago

@HLeithner

Here a Call Stack from German forum: https://forum.joomla.de/thread/13254-fehlermeldung-bei-aufrufen-von-kategorien-bei-addon-weblinks/?postID=83873#post83873


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/weblinks/429.

kcasarez commented 3 years ago

It appears Weblinks is trying to use the property "item", which is not defined for WeblinksViewCategory. I updated a few lines to change $this->item to $item, as they're contained in a for loop that iterates across all the links in the category. Also had to put in an If test to get around a $this->item reference outside of the loop. My only use case is displaying the links in a category, so I can't promise this is an absolute fix for all use cases. Apply these changes at your own risk, and make a backup copy of modified files so you can fall back to standard if it breaks other things.

In components/com_weblinks/views/category/tmpl/default_items.php I made the following changes:

Line 17:

Old: $params = &$this->item->params; New: $params = null; if (property_exists($this,"item")){ $params = &$this->item->params; }

Line 131-132 (Original, 132-133 after previous change):

Old: <?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?> <?php echo $this->item->tagLayout->render($tagsData); ?> New: <?php $item->tagLayout = new JLayoutFile('joomla.content.tags'); ?> <?php echo $item->tagLayout->render($tagsData); ?>


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/weblinks/429.

joomdonation commented 3 years ago

With the recent commits, the two reported issues are fixed. So I'm closing this.

rotech1 commented 2 years ago

I get this on a couple of Joomla 3.10.11 main menu items now ( just a couple, everything else is fine)... Just testing migration to PHP8


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/weblinks/429.

rotech1 commented 2 years ago

( Error: 0 - Attempt to modify property "params" on null )


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/weblinks/429.

joomdonation commented 2 years ago

@rotech1 Could you please let us know exactly what we need to do to see that error? I just tested all menu item types of weblinks extension on Joomla 3.10.11 and PHP 8.1.9 and could not see the error you mentioned.

ergotone commented 2 years ago

Sorry - false alarm, not weblinks specific - it was caused by J3.10.11 menu only when type Category -list (CAtegory - blog &etc are fine...), tracked it down to old Gantry used by our template!

joomdonation commented 2 years ago

@ergotone Ah, OK. Thanks for the update. I'm glad it is not a weblinks problem.

Kikokuko commented 1 year ago

Confirming: Since my IP upgraded to PHP8.0 Weblinks reports error

"#0 Attempt to assign property "tagLayout" on null"


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/weblinks/429.

joomdonation commented 1 year ago

@Kikokuko What Joomla and Weblinks version you are using? Could you please let us know step by step what we need to do to see the issue ourself?