Skip to content

Commit c3911f3

Browse files
committed
Fix Uncaught Error: Call to undefined function Magefan\Blog\Model\is_countable
1 parent d877154 commit c3911f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Model/TemplatePool.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ public function getAll(string $templateType):array
5252
*/
5353
public function getTemplate(string $templateType, string $name):string
5454
{
55-
if (isset($this->templates[$templateType]) && is_countable($this->templates[$templateType])) {
55+
if (isset($this->templates[$templateType]) &&
56+
(is_array($this->templates[$templateType]) || $this->templates[$templateType] instanceof Countable)
57+
) {
5658
foreach ($this->templates[$templateType] as $item) {
5759
if (isset($item['value']) && $item['value'] == $name) {
5860
return $item['template'];

0 commit comments

Comments
 (0)