Skip to content

Commit

Permalink
Fix Uncaught Error: Call to undefined function Magefan\Blog\Model\is_…
Browse files Browse the repository at this point in the history
…countable
  • Loading branch information
ihorvansach committed May 4, 2021
1 parent d877154 commit c3911f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Model/TemplatePool.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public function getAll(string $templateType):array
*/
public function getTemplate(string $templateType, string $name):string
{
if (isset($this->templates[$templateType]) && is_countable($this->templates[$templateType])) {
if (isset($this->templates[$templateType]) &&
(is_array($this->templates[$templateType]) || $this->templates[$templateType] instanceof Countable)
) {
foreach ($this->templates[$templateType] as $item) {
if (isset($item['value']) && $item['value'] == $name) {
return $item['template'];
Expand Down

0 comments on commit c3911f3

Please sign in to comment.