PHP 7 - Fatal error

Permalink Browser Info Environment
Hi,
i just want to let you know that PHP 7 requires a small modification in controller.php of the EasyImageGallery (1.3.1) block, in oder to avoid fatal errors:

packages/easy_image_gallery/blocks/easy_image_gallery/controller.php

public function registerViewAssets()

should be:
public function registerViewAssets($outputContent = '')


Best regards,
Michael

Type: Discussion
Status: In Progress
okapi
View Replies:
delusioninabox replied on at Permalink Reply
delusioninabox
Thank you!!!! You're a lifesaver!
okapi replied on at Permalink Reply
okapi
You're welcome!
There are even more pitfalls with arguments of some functions in controller.php of some add-ons, when C5 is running on PHP7. Fortunately, the error messages are descriptive enough to let even non-programmers know what has to be changed.
trimmeri replied on at Permalink Reply
trimmeri
This is still an issue, not a big thing to correct to code.

I used two hours of my life finding out the problem, just before spending 20 bucks.

Please fix.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
I gave up on this addon for the above error that still gets generated several months after it was reported! (NOT FIXED)
I also noted that every time the gallery was edited, every image in the gallery was assigned a new file version!
For a site with in excess of 100 users each editing their own gallery with up to 150 images per gallery, the FileVersions table in the database would soon bloat the database..
Goldsmith replied on at Permalink Reply
Goldsmith
This doesn´t work with php 7.2

Is there any posibility to fix it. It worked at my space using php 7.1, but not with higher versions. Can anybody help, or will i have to create this parts new?
jasteele12 replied on at Permalink Reply
jasteele12
It's working fine for me with PHP 7.3.12 and package version 1.3.2

There is no longer a registerViewAssets() function, just registerAssets().

What error are you getting (doesn't work doesn't help).
PaiviK replied on at Permalink Reply
PaiviK
This is one of my favorite galleries and I'm happy it is _allmost_ in working order again. Downloaded version 1.4.2 works with C5.8 and PHP7.1, but I have had problems with PHP7.2.

But today I got it working! I followed these instructions:

https://www.concrete5.org/community/forums/usage/concrete5-8.5.2-eas...


https://www.concrete5.org/marketplace/addons/easy-image-gallery/supp...

As suggested <? endif ?> was changed to <?php endif ?> in the following files
packages / easy_image_gallery / blocks / easy_image_gallery / view.php
packages / easy_image_gallery / blocks / easy_image_gallery / templates / basic / view.php
as well as in my own templates.
I think the masonry template was fine...


It also helped to change in
packages / easy_image_gallery / blocks / easy_image_gallery / templates / basic / view.php

Line 26
<<?php echo $tag ?> class="img ....

to
<a class="img ...


and Line 38
</<?php echo $tag ?>>

to
</a>


That should not mess the file up? And it was giving error...

concrete5 Environment Information

Concrete5 5.7.5.6
PHP 7

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.