Bug in editing dashlets when installing suitecrm on PHP 7

I’ve spent a countless hours investigating this issue without success. To summarize, I have the following two environments that are identical except for the PHP version:

environment 1: I install suitecrm on PHP 5.6 with apache on linux
environment 2: I install suitecrm on PHP 7.0 with apache on linux

The other libraries / requirements are exactly the same on both environments, yet no matter what I do, or whatever I install, I can never edit the dashlets on the PHP 7 environment. The moment I click edit on any dashlet I get an error message “There was an error handling this request”. Checking the logs of both suitecrm and apache I got no errors.

For completeness, I am showing below the exact docker built script I’m using to try and deploy suitecrm:

FROM debian:9

ARG APP_VERSION=7.9.8
ARG ARCHIVE=v${APP_VERSION}.zip
ARG EXTRACT_DIR=SuiteCRM-${APP_VERSION}
ARG WWW_DIR=/var/www/html

ADD https://github.com/salesagility/SuiteCRM/archive/${ARCHIVE} /tmp
COPY init.sh /usr/local/bin/init.sh

RUN apt-get update && apt-get upgrade -y
&& apt-get install -y
apache2
cron
libapache2-mod-php7.0
php7.0-curl
php7.0-gd
php7.0-gettext
php7.0-imap
php7.0-json
php7.0-mbstring
php7.0-mysql
php7.0-xml
php7.0-zip
unzip
zip
&& rm -rf /var/lib/apt/lists/*

WORKDIR /tmp

RUN unzip ${ARCHIVE} &&
rm ${ARCHIVE} &&
rm -rf ${WWW_DIR}/* &&
cp -R ${EXTRACT_DIR}/* ${WWW_DIR}/ &&
rm -rf ${EXTRACT_DIR} &&
chown -R www-data:www-data ${WWW_DIR} &&
chmod +x /usr/local/bin/init.sh &&
(crontab -l 2>/dev/null; echo “* * * * * cd /var/www/html; /usr/bin/php -f cron.php > /dev/null 2>&1”) | crontab -u www-data -

COPY php.ini /etc/php/7.0/apache2/php.ini

WORKDIR ${WWW_DIR}

EXPOSE 80 443

CMD [“init.sh”]

also forgot to mention that this thread is related to 57523

Hi taher, did you ever figure this out? I saw your messages in the other thread, but no follow-up by anyone who might have a solution. I’m having the exact same problem; I can’t edit any of the dashlets. Here’s my reply in that thread:

https://suitecrm.com/suitecrm/forum/suitecrm-7-0-discussion/8207-hosted-suitecrm-my-top-open-opportunities?start=15#59709

I’d really like to get this fixed. I can somewhat work around it by going directly to the Contacts (or whatever) page and doing the edit from there, but it’s very inefficient.

Thanks.

Hi Garlick

So despite my best efforts, I was unable insofar to make suitecrm work with PHP 7 no matter how hard I try. The folks from suitecrm seem to have got it working on their demo account on PHP 7 (I think) so it must be some hidden dependency or a library I’m unaware of.

I checked every log, ran dozens of docker builds with different settings, all from scratch, without success. Either the documentation is missing some critical dependency or something else in the environment must be set. Unfortunately, no luck in figuring this out so far.

Hi taher, that’s unfortunate.

I tried changing PHP to 5.6 (from 7.0) but it didn’t affect the behavior at all, although I understand that it did for you. I cleared my browser’s cache after making the change, but I still get these error messages in error_log whenever I click on a dashlet’s pencil button:

[13-Feb-2018 13:19:47 America/Chicago] PHP Strict Standards: Declaration of SugarWidgetFieldDateTime::displayInput() should be compatible with SugarWidgetField::displayInput($layout_def) in /home2/garlick/public_html/SuiteCRM-7.9.12/include/generic/SugarWidgets/SugarWidgetFielddatetime.php on line 45
[13-Feb-2018 13:19:47 America/Chicago] PHP Strict Standards: Declaration of SugarWidgetFieldVarchar::displayInput() should be compatible with SugarWidgetField::displayInput($layout_def) in /home2/garlick/public_html/SuiteCRM-7.9.12/include/generic/SugarWidgets/SugarWidgetFieldvarchar.php on line 106
[13-Feb-2018 13:19:47 America/Chicago] PHP Strict Standards: Declaration of SugarWidgetFieldName::queryFilterone_of() should be compatible with SugarWidgetFieldVarchar::queryFilterone_of(&$layout_def) in /home2/garlick/public_html/SuiteCRM-7.9.12/include/generic/SugarWidgets/SugarWidgetFieldname.php on line 288
[13-Feb-2018 13:19:47 America/Chicago] PHP Strict Standards: Declaration of SugarWidgetFieldName::displayList() should be compatible with SugarWidgetField::displayList($layout_def) in /home2/garlick/public_html/SuiteCRM-7.9.12/include/generic/SugarWidgets/SugarWidgetFieldname.php on line 288

BTW, the one exception is the My History dashlet; the pencil icon works for that one, but not for Accounts, Contacts, Leads, Top Ten Opportunities, Meetings, or Calls dashlets.

Yeah same with me, only the history dashlet works. Interesting, at least you got errors in your log!

Are you trying from scratch? Perhaps you can check the SugarWidgetFielddatetime.php … perhaps you can review the dependencies from that file by looking at the imported libraries.

I have a feeling it could also be a php.ini settings, since it mentioned something about strict mode.

Hello!

On our demo instance we run 7.1 and 7.2 for our tests. I wouldn’t think it would be specific to 7.0 but something we may need to look into.

BUT you could be onto something there taher about the strict. The latest PHP versions will execute a failure if there are any strict error logs in the application. What I would recommend is to reduce the error_reporting by adding & ~E_STRICT to it. If you wanted to go a step further you could hide deprecated & ~E_DEPRECATED

Remember to save, restart and watch the logs :slight_smile:

Let us know how you get on.

I was actually playing with this yesterday, but I’m not a PHP programmer so I don’t think I’m doing it quite right. I don’t have access to the system-wide php.ini file (I’m on a. shared hosting platform at hostgator), but I tried modifying index.php in the SuiteCRM home directory. I tried this:

[color=#0000bb]error_reporting(E_ALL ^ E_STRICT);[/color]

and:

[color=#0000bb]error_reporting(E_ALL & ~E_STRICT);[/color]

I wrote the file (using vi) and then reloaded the Dashboard page, but it didn’t affect anything. You did say to restart though; how do I do that? Maybe that’s the piece that I’m missing.

Thanks,

-Tim.

A restart means simply restarting the web server so that changes to PHP settings are reloaded. A reboot would have the same effect.

We are also suffering from this issue. Going to make the PHP changes suggested above and see if that fixes it.