Error when using emailOnApproved plugin with PHP 7.4

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 26, 2021   (RSS)

By gkornbluth - May 20, 2021 - edited: May 23, 2021

Hi All,

I have an event listing system that allows a musician to request an event listing.

The request generates an email to the admin with a link similar to the following that adds the listing record when clicked on.

http://mysite.com/cmsAdmin/admin.php?menu=list_my_event&action=add&hidden=1&neverRemove=1&approved=1&band_name=Joes+Band&email=jerry%40ajrecording.com&instrument=&parking=&wheelchair=&cover=%2425&contact_first_name=Joe&contact_last_name=Jones&venue_name=Harry%27s+Bar&venue_street_address=123+4th+St&event_title=Test+7.3&venue_city=New+Orleans&venue_state=LA&venue_zip=12345&venue_phone=&event_description=A+great+event&event_date=2021-06-15&event_date1=&event_time=7%3A00&website=&facebook=&travel_directions=2+blocks+from+nowhere

I’ve been successfully using a simple plugin called emailOnApproved (attached) to send an email to the person listing an event when an approved checkbox is checked in the new record.

The system works perfectly in PHP 7.3 but throws the attached error with PHP 7.4.

Creating a listing record manually (with the plugin enabled) throws the same error in PHP 7.4.

There is no error thrown when the emailOnApproved plugin is deactivated.

Any ideas

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By Dave - May 25, 2021

Hi Jerry, 

Can you try just hiding the warnings and see if everything still works?  Just add @ as follows:

  $wasChecked   = intval(!@$oldRecord[$fieldname] && @$_REQUEST[$fieldname]);
  $wasUnchecked = intval(@$oldRecord[$fieldname]  && !@$_REQUEST[$fieldname]);

Let me know if that works for you.

Dave Edis - Senior Developer
interactivetools.com

By gkornbluth - May 26, 2021

Hi Dave,

I really appreciate your looking at this.

When I hid the errors, everything seemed to function correctly and no errors popped up when saving the new record, but there's still an error thrown in the error log.

E_WARNING: A non-numeric value encountered
/home4/zcfzmsmy/public_html/jazzonjstreet/cmsAdmin/lib/menus/default/edit_functions.php (line 382)

Thanks,

Jerry

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php