News:

Support the VirtueMart project and become a member

Main Menu

Warning: vmpagination.php

Started by marvays, November 22, 2018, 04:51:01 AM

Previous topic - Next topic

marvays

Good morning. What is this error, please:
Warning: count(): Parameter must be an array or an object that implements Countable in /data/www/23045/lukysipy_cz/www/administrator/components/com_virtuemart/helpers/vmpagination.php on line 140

I have latest joomla and latest VM.

AH

Provide more information as to what you are doing when you get this error.  As you appear to be the only one reporting it.

Saying that you are on the latest versions means nothing - please state the version you are using.
Regards
A

Joomla 3.10.11
php 8.0

marvays

hi.
VirtueMart 3.4.2
Joomla! 3.9.0

display in all pages where is pagination.


GJC Web Design

normally means the count($xxx) is not an array or object

you need to backtrace what is being "counted" -- maybe it needs a if(is_array($xxx)) { etc

code is

         if(empty($sequence)) {
            $sequence = VmConfig::get( 'pagseq', 0 );
         }

         if(!empty($sequence)) {
            $sequenceArray = explode( ',', $sequence );
            if(count( $sequenceArray>1 )) {
               foreach( $sequenceArray as $items ) {
                  $limits[$items] = JHtml::_( 'select.option', $items );
               }
            }
         }

what have u got in your pagination sequence in VM config?

must be comma separated
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation


marvays

I try delete this:
if(!empty($sequence)) {
$sequenceArray = explode( ',', $sequence );
if(count( $sequenceArray>1 )) {
foreach( $sequenceArray as $items ) {
$limits[$items] = JHtml::_( 'select.option', $items );
}
}
}

and look fine :)

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

marvays

Yes. But i can change to 7.1 or 5.6 . . . if you want.

Milbo

It should work in any relevant php version, but I think at most intersting is php7.2.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

biltong

Hi,

Am am getting this error as well, in PHP error log file, since updating VirtueMart from 3.2.14 to 3.4.2.

[14-Feb-2019 17:44:08 Europe/London] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /home/xxxxx/public_html/administrator/components/com_virtuemart/helpers/vmpagination.php on line 190


Joomla v3.9.5
PHP 7.2.16

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jamesofdps

Can you confirm if version 3.6.2 successfully addresses the PHP Warning:  count(): Parameter must be an array or an object that implements Countable in administrator/components/com_virtuemart/helpers/vmpagination.php on line 140 issue or advise of an alternative fix.

GJC Web Design

It is assumed so as I and none of the testers/devs have seen this problem
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation