blocktype/externalfeed/lib.php:84 count(): Parameter must be an array or an object that implements Countable

Bug #1916648 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Lisa Seeto
21.04
Fix Released
Medium
Lisa Seeto
21.10
Fix Released
Medium
Unassigned

Bug Description

We need to check that the variable is not empty and is an array before we can do the counting

Robert Lyon (robertl-9)
Changed in mahara:
assignee: nobody → Lisa Seeto (lisaseeto)
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/11569

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

To replicate:

1. Set up a page with and 'External feed' block.
2. Use the feed URL https://www.feedforall.com/sample.xml in the block.
3. Set the 'Items to show' to 0 and save the block.
4. View the page

Expected result: A sensible alert or a default display of items as 0 is not an allowed number.
Actual result: Failure with big error message.

What to do: When 0 is selected, then default to show 10 results.

no longer affects: mahara/20.10
no longer affects: mahara/19.10
no longer affects: mahara/20.04
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Since only 1-20 and not 0 should be used, I removed the other branches as that bug fix is not such a high priority any more. In general, if we only allow numbers, then it might be good to have a drop-down menu with the possible numbers.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11569
Committed: https://git.mahara.org/mahara/mahara/commit/9b172dc9bc772bf3dcb5308bf92b8d6e0b32aff4
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 9b172dc9bc772bf3dcb5308bf92b8d6e0b32aff4
Author: Lisa Seeto <email address hidden>
Date: Wed Feb 24 09:47:06 2021 +1300

Bug 1916648: Param must implement countable

- if count has been supplied, use that otherwise default to 10

Change-Id: I754a070198b4cff2b294a2326ccf6ae83932e73c
Signed-off-by: Lisa Seeto <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "21.04_STABLE" branch: https://reviews.mahara.org/11762

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11762
Committed: https://git.mahara.org/mahara/mahara/commit/a6c39472af7252910a260f53c6f74ce13c5bb8d4
Submitter: Robert Lyon (<email address hidden>)
Branch: 21.04_STABLE

commit a6c39472af7252910a260f53c6f74ce13c5bb8d4
Author: Lisa Seeto <email address hidden>
Date: Wed Feb 24 09:47:06 2021 +1300

Bug 1916648: Param must implement countable

- if count has been supplied, use that otherwise default to 10

Change-Id: I754a070198b4cff2b294a2326ccf6ae83932e73c
Signed-off-by: Lisa Seeto <email address hidden>
(cherry picked from commit 9b172dc9bc772bf3dcb5308bf92b8d6e0b32aff4)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.