I installed it, but if I try to edit the top page even though I can edit the subpage, I get an error.

Permalink
Hello
Purchase the GENESIS theme at the marketplace,
I installed it, but if I try to edit the top page even though I can edit the subpage, I get an error.
I will also fill in the debug display.
I would like someone who knows the cause to answer.


Whoops \ Exception \ ErrorException (E_WARNING)
count (): Parameter must be an array or an object that implements Countable


/home/demo/demo.jp/public_html/demo/packages/c5box_genesis/blocks/page_list/templates/c5box_plist_4col_carousel/view.php

6. $ i = 0;
7.
8.
9.if ($ c-> isEditMode ()) {
10.?>
11. <div class = "ccm-edit-mode-disabled-item" style = "<? Php echo isset ($ width)?" Width: $ width; ": ''?> <? Php echo isset ($ height )? "height: $ height;": ''?> ">
12. <i style = "font-size: 40px; margin-bottom: 20px; display: block;" class = "fa fa-picture-o" aria-hidden = "true"> </ i>
13. <div style = "padding: 40px 0px 40px 0px"> <? Php echo t ('Carousel disabled on edit mode.')?>
14. <div style = "margin-top: 15px; font-size: 9px;">
15. <i class = "fa fa-circle" aria-hidden = "true"> </ i>
16. <? Php if (count ($ rows)> 0) {?>
17. <? Php foreach (array_slice ($ rows, 1) as $ row) {?>
18. <i class = "fa fa-circle-thin" aria-hidden = "true"> </ i>
19. <? Php}
20.}
21.?>
22. </ div>
23. </ Div>
24. </ Div>
25. <? Php
26.} else {
27.?>
28.
29. <div class = "pagelistwrapper">
30. <? Php if ($ rssUrl):?>
31. <a class="pull-right" href="<?php echo $rssUrl ?> "target =" _ blank "class =" ccm-block-page-list-rss-feed "> <i class =" fa fa-rss "> </ i> </a>
32. <? Php endif;?>


Setting environment
Composer in concrete5 8.5.1
Xserver
PHP7 version: 7.2.6
MySQL version: 5.7.x
Themes: Genesis: 1.1.9

 
Gondwana replied on at Permalink Reply
Gondwana
I think that error indicates that the theme needs to be updated to be compatible with more recent versions of php (such as that which you're running). You could try contacting the theme developer at
https://www.concrete5.org/marketplace/themes/genesis57/support...
dsds replied on at Permalink Reply
Thank you Gondwana.
I contacted the author, but I can't reply.
If you know how to fix it, please do it.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Attach the view.php file here as a view.txt file so I can take a look at the code.
dsds replied on at Permalink Reply
Thank you very much.

We will upload the file, so please check it.

c5box_genesis / blocks / page_list / templates / c5box_plist_4col_carousel / view.php



<?php
defined('C5_EXECUTE') or die("Access Denied.");
$th = Loader::helper('text');
$c = Page::getCurrentPage();
$dh = Core::make('helper/date'); /* @var $dh \Concrete\Core\Localization\Service\Date */
$i = 0;


if ($c->isEditMode()) {
?>
<div class="ccm-edit-mode-disabled-item" style="<?php echo isset($width) ? "width: $width;" : '' ?><?php echo isset($height) ? "height: $height;" : '' ?>">
<i style="font-size:40px; margin-bottom:20px; display:block;" class="fa fa-picture-o" aria-hidden="true"></i>
<div style="padding: 40px 0px 40px 0px"><?php echo t('Carousel disabled on edit mode.')?>
<div style="margin-top: 15px; font-size:9px;">
<i class="fa fa-circle" aria-hidden="true"></i>
<?php if (count($rows) > 0) { ?>
<?php foreach (array_slice($rows, 1) as $row) { ?>
<i class="fa fa-circle-thin" aria-hidden="true"></i>
<?php }
}
?>
</div>
</div>
</div>
<?php
} else {
?>

<div class="pagelistwrapper">
<?php if ($rssUrl): ?>
<a class="pull-right" href="<?php echo $rssUrl ?>" target="_blank" class="ccm-block-page-list-rss-feed"><i class="fa fa-rss"></i></a>
<?php endif; ?>
<?php if ($pageListTitle): ?>
<div class="ccm-block-page-list-header">
<h2><?php echo $pageListTitle?></h2>
</div>
<?php endif; ?>



<div class="pagelistwrapper">
<div class="pagelistcont">
<div class="row">


<div class="carousel slide" id="fourcolumn-carousel">
<div class="carousel-inner">


<?php foreach ($pages as $page):
$i++;

$buttonClasses = 'ccm-block-page-list-read-more';
$entryClasses = 'ccm-block-page-list-page-entry';
$title = $th->entities($page->getCollectionName());
$url = $nh->getLinkToCollection($page);
$target = ($page->getCollectionPointerExternalLink() != '' && $page->openCollectionPointerExternalLinkInNewWindow()) ? '_blank' : $page->getAttribute('nav_target');
$target = empty($target) ? '_self' : $target;
$description = $page->getCollectionDescription();
$description = $controller->truncateSummaries ? $th->wordSafeShortText($description, $controller->truncateChars) : $description;
$description = $th->entities($description);

$thumbnail = $page->getAttribute('thumbnail');

$includeEntryText = false;
if ($includeName || $includeDescription || $useButtonForLink) {
$includeEntryText = true;
}
if (is_object($thumbnail) && $includeEntryText) {
$entryClasses = 'ccm-block-page-list-page-entry-horizontal';
}

$date = $dh->formatDateTime($page->getCollectionDatePublic(), true);


?>
<div class="item <?php if($i == 1){echo "active";} ?>">
<div class="col-sm-3 col-md-3">

<?php if (is_object($thumbnail)): ?>
<h3>
<a class="img-bgcover" href="<?php echo $url; ?>" style="height:150px; background: url(<?php
$tag = $thumbnail->getRelativePath();
echo $tag;
?>) no-repeat center center;-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;">
 
</a>
</h3>
<?php endif; ?>
<?php if ($includeEntryText): ?>
<?php if ($includeName): ?>
<?php if ($useButtonForLink) { ?>
<h3><?php echo $title; ?></h3>
<?php } else { ?>
<h3><a href="<?php echo $url ?>" target="<?php echo $target ?>"><?php echo $title ?></a></h3>
<?php } ?>

<?php endif; ?>

<?php if ($includeDate): ?>
<p class="brimdate"><i class="fa fa-calendar"></i> <?php echo $date?></p>
<?php endif; ?>

<?php if ($includeDescription): ?>
<p>
<?php echo $description ?>
</p>
<?php endif; ?>

<?php if ($useButtonForLink): ?>
<p>
<a class="btn btn-default <?php echo $buttonClasses?>" href="<?php echo $url?>"><?php echo $buttonLinkText?></a>
</p>
<?php endif; ?>

</div>
</div>
<?php endif; ?>







<?php endforeach; ?>

</div>
<a class="left carousel-control" href="#fourcolumn-carousel" data-slide="prev"><i class="fa-chevron-circle-left"></i></a>
<a class="right carousel-control" href="#fourcolumn-carousel" data-slide="next"><i class="fa-chevron-circle-right "></i></a>
</div></div></div></div>

<?php if (count($pages) == 0): ?>
<div class="ccm-block-page-list-no-pages"><?php echo $noResultsMessage?></div>
<?php endif;?>

</div>


<?php if ($showPagination): ?>
<?php echo $pagination;?>
<?php endif; ?>

<?php } ?>
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
I will send you the modified file as an attachment in a Private Message.
Please follow my instructions when you receive it.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
I have sent the file now as a view.txt file, it will have to be renamed to view.php as per my instructions.
dsds replied on at Permalink Reply
I uploaded it as instructed, but my symptoms were severe.

syntax error, unexpected end of file

The above error is displayed.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
That is the problem when trying to work blindfolded, I was unable to test the file because I do not have a copy of your theme.
Just delete the new file and rename your view-old.php file back to view.php (as per the instructions) for the time being.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Second file sent as a zip archive - let me know the results.
dsds replied on at Permalink Reply 1 Attachment
The site has returned.
I do not know the contents, but send ZIP.
dsds replied on at Permalink Reply
An unexpected error has occurred.

syntax error, unexpected end of file

I thought it improved
An error still occurs.
Occurs when the page type is set to Home.
The initial page is Home, and I like it, so I want to edit it, but I can't do it with an error.
dsds replied on at Permalink Reply 1 Attachment
Upload a debug image.

syntax error, unexpected end of file

The above error.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Version 3 file has been sent as a zipped file.
dsds replied on at Permalink Reply 1 Attachment
Many times Thank you.
Applied but it is also an error.
An unexpected error has occurred.

count (): Parameter must be an array or an object that implements Countable

Thank you.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Check you mailbox for new file...
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
That new file works okay doesn't it...
That is the good news.
The bad news is that all remaining 11 template files have 'Countable' errors.
I can patch these for you if you need to use any of them
dsds replied on at Permalink Reply
Thank you very much.
There is only appreciation.
I'm really thankful to you.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
PHP7 is less tolerant of coding errors and will throw an error up when it detects any.
In this instance the errors were patched by...

Changing this code
<?php if (count($rows) > 0) { ?>
<?php foreach (array_slice($rows, 1) as $row) { ?>
<i class="fa fa-circle-thin" aria-hidden="true"></i>
<?php }
}
?>

To this
<?php 
if (is_array($rows) ) {
if (count($rows) > 0) { 
foreach (array_slice($rows, 1) as $row) { ?>
<i class="fa fa-circle-thin" aria-hidden="true"></i>
<?php }
}
}
?>

And this code
<?php if (count($pages) == 0): ?>
<div class="ccm-block-page-list-no-pages"><?php echo $noResultsMessage?></div>
<?php endif;?>

To this
<?php 
if (is_array($pages) ) {
if (count($pages) == 0): ?>
<div class="ccm-block-page-list-no-pages"><?php echo $noResultsMessage?></div>
<?php endif; } ?>
dsds replied on at Permalink Reply
15 is all view.php?
Should I fix all the same places?
Thanking you in advance.
dsds replied on at Permalink Reply
I would like to modify those 15 files as soon as possible.
I asked the author to correct it, but please let me know because I don't know when.
Thanking you in advance.
ConcreteOwl replied on at Permalink Best Answer Reply 1 Attachment
ConcreteOwl
There were in fact 11 more files needing patching.
Two of them are view.php files and the remainder have various file names.
I have attached a zipped up templates folder for the page_list block that has the patched files within.
Pixelfixer replied on at Permalink Reply
Pixelfixer
THANK YOU!! for posting this fix!
I simply uploaded the templates folder, removing the original, and my problem was resolved.
You saved me a TON of time!
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Your welcome, I am happy to have helped...
dsds replied on at Permalink Reply
I'm sorry many times.
I installed a comment block and made a test comment while logged in as an administrator. The first post was made, but when I tried to edit the comment, an error occurred and I could not edit it.
The contents of the error log are
2019/11/11 21:51:03  Exception another Exception Occurred: /home/test/test.com/public_html/blog/concrete/tools/conversations/update_message.php:36 count (): Parameter must be an array or an object that implements Countable (2)
It becomes.

Is there a way to improve it?
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Which version of concrete are you using?
ConcreteOwl replied on at Permalink Reply 1 Attachment
ConcreteOwl
The error is coming from concrete/tools/conversations/update_message.php
Try replacing the update_message.php with the one I have attached as a zip file.
dsds replied on at Permalink Reply
Thank you very much.
Just in case, application / tools / conversations / update_message.php
We improved when we installed in.
Thank you very much.

Thank you in the future.
dsds replied on at Permalink Reply
I'm always sorry.
This is the Japanese version of concrete5 8.5.2.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
I am happy to have helped and glad that it worked...
dsds replied on at Permalink Reply
Thank you for your response. There is a little problem. It takes a long time to read comments. It's been a long time. Is there something wrong? Thank you.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Message Redacted
dsds replied on at Permalink Reply
How do you feel about the other day?
Thank you.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
I asked you to send me your environment information as read from the system & settings section of your site.
I only received a little info from you was of no use to me.
I did send you a PM asking for the full environment text but not had a reply to that PM...