downloadEmail error on Save

4 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: September 20   (RSS)

I have just installed downloadEmail plugin fir first time. Its purpose for this site is to allow us to create a section editor based upon the _incoming_mail table from which site users can access submitted email content.

It works fine in that regard.

However, I would like to control postings going live on the site until an admin has ruled them publish-worthy. As I have often done for other similar situations, I created a "Publish" checkbox in the _incoming_mail table so that my query can limit results to only those set to publish. However, when I check the "Publish" box and attempt to save the record, I receive a forbidden error, (see attachment).

Is the _incoming_mail table configured in such a way as to disallow what I am trying to do?

Thanks.

Attachments:

CMSBError.webp 40K

Hello pgplast,

Sorry I hadn't seen this sooner. Hopefully you got this resolved on your own, but if not I have a fix for you. The bug you encountered is something I have seen in another project using download mail so thought I would provide a fix below for anyone else who may encounter the problem inside the download mail plugin...

function _mb_convert_to_utf8($string, $fromEncoding, $defaultEncoding = 'UTF-8') {
  $encoding = (!is_null($fromEncoding) && _mb_is_valid_encoding($fromEncoding)) ? $fromEncoding : $defaultEncoding;
  return mb_convert_encoding($string, 'UTF-8', $encoding);
}

The error occurs due to the $fromEncoding sometimes being null. Here we check for it. If it is null, we will use the default encoding (UTF-8). 

Before implementing, be sure to backup your plugin. Keep in mind that this fix will get overwritten if you choose to update the plugin. I will have Dave put it in the next official release of the plugin.

Thanks again for the report!

Tim Hurd
Senior Web Programmer
Interactivetools.com

Thanks very much, Tim.

Dave had earlier provided a similar solution.

Appreciate the followup.

Philip