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

mod_weblinks Warning: count(): Parameter must be an array #432

Closed ReLater closed 3 years ago

ReLater commented 3 years ago

Summary of Changes

Testing Instructions

Actual result

ChristineWk commented 3 years ago

Could this be closed? #422?


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

ReLater commented 3 years ago

My pr is only for the module. Looks like #422 is also talking about the component. Therefore: I don't know.

BertaOctech commented 3 years ago

Hi, I installed com_weblinks 4.0.0-dev in Joomla version, ‎4.0.0-beta8-dev.

I receive an error at administrator/index.php?option=com_categories&extension=com_weblinks

1054 Unknown column 'c.published' in 'field list'

Which com_weblinks should I have installed?


Database Type mysql

10.4.17-MariaDB utf8mb4_general_ci utf8mb4_general_ci None No 7.3.27 Apache/2.4.46 (Unix) OpenSSL/1.1.1i PHP/7.3.27 mod_perl/2.0.11 Perl/v5.32.1 apache2handler Joomla! 4.0.0-beta8-dev Development [ Mañana ] 2-February-2021 20:02 GMT Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0

joomdonation commented 3 years ago

@ReLater If you look at the model class, it could return false https://github.com/joomla-extensions/weblinks/blob/master/src/components/com_weblinks/models/category.php#L76 (in case database failure) and for that case, the error still happens.

I updated your PR abit to return empty array for that case. Hope that is OK for you.

joomdonation commented 3 years ago

Before patch, there is an error

error

After patch, the error is gone.

So I will merge this PR and we can continue working on other issues. Thanks !