Support Forums

Support Offline : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

Error Warning: in_array() expects parameter 2

Featured Lock Resolved Bug
I updated to Joomla 3.7.5 from 3.7.4 and get this error.

Warning: in_array() expects parameter 2 to be array, string given in /home/yourhome/public_html/components/com_sppagebuilder/helpers/articles.php on line 39

Warning: in_array() expects parameter 2 to be array, string given in /home/yourhome/public_html/components/com_sppagebuilder/helpers/articles.php on line 39

1 Answers

Toufiq - Staff

More than a month ago #Permalink
Hi,

Download the attachment and replace the file location

components/com_sppagebuilder/helpers/

Old code

// Category filter
if ( ($catid != '' || is_array($catid)) && !in_array('', $catid) ) {
if (!is_array($catid)) {
$catid = array($catid);
}
$categories = self::getCategories( $catid, $include_subcategories );
$categories = array_merge($categories, $catid);
//array_unshift($categories, $catid);

$query->where($db->quoteName('a.catid')." IN (" . implode( ',', $categories ) . ")");
}


New code

// Category filter
if ( ($catid != '' || is_array($catid)) ) {

if (!is_array($catid)) {
$catid = array($catid);
}

if (!in_array('', $catid)) {
$categories = self::getCategories( $catid, $include_subcategories );
$categories = array_merge($categories, $catid);
//array_unshift($categories, $catid);

$query->where($db->quoteName('a.catid')." IN (" . implode( ',', $categories ) . ")");
}
}


-Thanks

Attachments (1)

  • articles.zip 3.2 KB


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Leaderboard (30 days)

Sifat

Sifat

Total Accepted Answers: 135
Paul Frankowski

Paul Frankowski

Total Accepted Answers: 121
Toufiq

Toufiq

Total Accepted Answers: 65
Pavel

Pavel

Total Accepted Answers: 5
Peter Atkin

Peter Atkin

Total Accepted Answers: 2

100+

Templates

200,000+

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us