Semanticmediawiki: Recurring PHP Warnings in master-18403e3

Created on 3 Sep 2018  路  2Comments  路  Source: SemanticMediaWiki/SemanticMediaWiki

Setup and configuration

  • SMW version: dev-master 18403e3
  • MW version: 1.31.0
  • PHP version: 7.2
  • DB system (MySQL, Blazegraph, etc.) and version: MySQL 14.14

Issue

Recurring PHP Warnings in the error log:

PHP Warning:  array_reverse() expects parameter 1 to be array, object given in extensions/SemanticMediaWiki/src/Page/ListBuilder/ValueListBuilder.php on line 123
PHP Warning:  count(): Parameter must be an array or an object that implements Countable in extensions/SemanticMediaWiki/src/Page/ListBuilder/ValueListBuilder.php on line 128

Steps to reproduce

Unknown,

bug

Most helpful comment

@@ -117,10 +117,14 @@ class ValueListBuilder {
            $isValueSearch = true;
        } else {
            $dataItems = $this->store->getAllPropertySubjects( $property, $options );
        }

+       if ( $dataItems instanceof \Iterator ) {
+           $dataItems = iterator_to_array( $dataItems );
+       }

That should help.

On 9/3/18, Hypolite Petovan notifications@github.com wrote:

Setup and configuration

  • SMW version: dev-master 18403e3
  • MW version: 1.31.0
  • PHP version: 7.2
  • DB system (MySQL, Blazegraph, etc.) and version: MySQL 14.14

Issue

Recurring PHP Warnings in the error log:

PHP Warning:  array_reverse() expects parameter 1 to be array, object given
in extensions/SemanticMediaWiki/src/Page/ListBuilder/ValueListBuilder.php on
line 123
PHP Warning:  count(): Parameter must be an array or an object that
implements Countable in
extensions/SemanticMediaWiki/src/Page/ListBuilder/ValueListBuilder.php on
line 128

Steps to reproduce

Unknown,

--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/3408

All 2 comments

@@ -117,10 +117,14 @@ class ValueListBuilder {
            $isValueSearch = true;
        } else {
            $dataItems = $this->store->getAllPropertySubjects( $property, $options );
        }

+       if ( $dataItems instanceof \Iterator ) {
+           $dataItems = iterator_to_array( $dataItems );
+       }

That should help.

On 9/3/18, Hypolite Petovan notifications@github.com wrote:

Setup and configuration

  • SMW version: dev-master 18403e3
  • MW version: 1.31.0
  • PHP version: 7.2
  • DB system (MySQL, Blazegraph, etc.) and version: MySQL 14.14

Issue

Recurring PHP Warnings in the error log:

PHP Warning:  array_reverse() expects parameter 1 to be array, object given
in extensions/SemanticMediaWiki/src/Page/ListBuilder/ValueListBuilder.php on
line 123
PHP Warning:  count(): Parameter must be an array or an object that
implements Countable in
extensions/SemanticMediaWiki/src/Page/ListBuilder/ValueListBuilder.php on
line 128

Steps to reproduce

Unknown,

--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/3408

Thanks a lot for reporting. I have created a pull request containing the proposed code changes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaideraf picture jaideraf  路  3Comments

alex-mashin picture alex-mashin  路  4Comments

osnard picture osnard  路  3Comments

mwjames picture mwjames  路  3Comments

seth2740 picture seth2740  路  3Comments