dudaster / ele-custom-skin

Create a skin for Elementor Pro Post and Post Archive widgets using Elementor templates
GNU General Public License v3.0
59 stars 10 forks source link

Fatal Error when leaving limit field empty #909

Open codewizard13 opened 1 year ago

codewizard13 commented 1 year ago

As @nonuniverse and @decpress mentioned here, it appears that Ele Custom Skin is abandoned or not-well supported.

In that case, I wanted to post a code solution / hack I came up with to fix this problem. What problem? When you set a "limit" value for some property (sorry, apparently I didn't document the incident as well as I should have) if you leave the field blank, the result is a Fatal Error that breaks the site. I don't recall if it breaks the front end, but it definitely throws and error on the back end.

Because there is absolutely no support being provided, I debugged the issue and would like to post my solution for anyone who has the same issue.

Files affected:

WordFence file differences for post-summary.php showing

Solution:

Change the $limit statement on/near line 51 of post-summary.php from

$limit = $settings['length']; 

to

// If no limit set, default to zero
$limit = $settings['length'] ? $settings['length'] : 0;

I cannot claim this is the absolute best solution, but I know it got me up and running again. Pretty simple. I hope this was helpful to you. Perhaps @ramiy and @dudaster can weigh in on this issue?

P.S.: If you using the WordFence security plugin it may detect this change - you can "ignore" the file difference as safe since you are the one who changed the file.