Error on php7

Permalink Browser Info Environment
Hey there,

I am using your great Add-On on a Project, where it should integrate with another custom-built package.

This was running well on php5.6, now I am trying to move everything to php7.

As concrete5 version 5.6.4 (GitHub) is built to work with php7, it seemed easier to move this direction as to re-build everything for v 5.7+

Now, everything works just fine except formidable.

This error is shown in the logs:

/var/www/domain.tld/updates/concrete5.6.4_updater/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php:80 mysqli error: [-9999: Input array has 3 params, does not match query: 'SELECT COUNT(answerSetID) AS total
FROM FormidableAnswerSets
WHERE formID = ?
AND temp != 1'] in Execute(, ) (-9999)

Type: Discussion
Status: In Progress
Cahueya
View Replies:
DeWebmakers replied on at Permalink Reply
DeWebmakers
Hi,

Sorry for the late reply. Missed this support request...
IS this still an issue?!

Best,

Corretje
webpresso replied on at Permalink Reply
webpresso
Hi corretje

We run into the same problem on securing an older concrete5 installation.
Same errors.

Additional observation:
It occurs after the upgrade to the concrete5.6.4 (even on PHP 5.6). But with 5.6.4 I'm able to run the whole installation on PHP7.1 - only formidable produces the error. So fixing this for this package could help us to run older installations a bit longer.

best regards, Roland
DeWebmakers replied on at Permalink Reply
DeWebmakers
Hi Roland,

Could you change the following code and see what happens?!
/packages/formidable/models/formidable/forms.php, line: 202
public function countResults($by = '', $value = '', $return = false)
   {
      $this->submissions = 0;
      $db = Loader::db();
      $q = "SELECT COUNT(answerSetID) AS total 
           FROM FormidableAnswerSets 
           WHERE formID = ?
           AND temp != 1";
      if ($by != '' && $value != '')
         $q .= " AND ? = ?";
      $data = $db->getOne($q, array($this->formID, $by, $value));
      if ($data)
         $this->submissions = $data;
      if ($return)
         return $this->submissions;

to
public function countResults($by = '', $value = '', $return = false)
   {
      $this->submissions = 0;
      $db = Loader::db();
      $q = "SELECT COUNT(answerSetID) AS total 
           FROM FormidableAnswerSets 
           WHERE formID = ?
           AND temp != 1";
      $v = array($this->formID);
      if ($by != '' && $value != '') {
         $q .= " AND ? = ?";
         $v[] = $by;
         $v[] = $value;
      }
      $data = $db->getOne($q, $v);


That should fix the error. But maybe you are getting some more... Not sure.

Best,

Corretje
webpresso replied on at Permalink Reply
webpresso
Thanks, corretje

There's a second function which I had to correct:
public function lastResult…

And then the error was gone.

There were more errors after changing to php 7.1
I could fix some of them. But going to the backend i couldn't get access to the result page.
So it was not a good idea for updating. ;-)

Perhaps it's a big too big to fix for me.
TeKnoZiz replied on at Permalink Reply
TeKnoZiz
Same error here and the patch didn't fix the problem either on PHP 5.6.32 or 7.1.12. Is this something you are still investigating?
DeWebmakers replied on at Permalink Reply
DeWebmakers
Hi,

Not really... Working with C5.6 on PHP7 is hard....

Best,

Corretje

concrete5 Environment Information

# concrete5 Version
5.6.4.0

# concrete5 Packages
5BN Kopernikus project (0.3), Anmelden (1.1.1), Attribute Block (1.0.6.1), Designer Content (3.1.1), Event Tester (2.1), Formidable (2.0.9), Front End File Uploader (2.2.2), Image Caption (1.5.1), Instant CSS (1.0), Lerteco Simple Content (1.0.6), List files from set (1.0.4), Magic Data (2.9.8), Magic Data Symbols1 (2.7.5), Magic Data Templates1 (2.1), MindNet Optimize MySQL database (1.11), Page List+ (5.6.0.0.0.5.5), Parent Link (1.0), PHP block by ND (1.0), Picmonkey Image Editor (1.00), Register User Pro (1.3.11), Registrant Group (1.1), Search Block Templates (1.0), Skyline (0.9.6), Uber List (1.6.1), User Info (1.97).

# concrete5 Overrides
blocks/search, blocks/autonav, blocks/jumbo, blocks/berichtfeld, blocks/login, blocks/jb_register, elements/files, elements/profile, elements/workflow, css/view.css, languages/de_DE, mail/ORG_private_message.php, mail/private_message.php, models/composer_page.php, models/workflow, single_pages/profile, single_pages/dashboard, single_pages/register.php, single_pages/bak_login.php, themes/XY_methoden.php, tools/BAK_page_controls_menu_js (04.12.14 10:46).php, tools/page_controls_menu_js.php, tools/workflow

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off

# Server Software
nginx/1.10.3

# Server API
fpm-fcgi

# PHP Version
7.0.27-0+deb9u1

# PHP Extensions
calendar, cgi-fcgi, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, json, libxml, mbstring, mcrypt, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, Phar, posix, readline, Reflection, session, shmop, SimpleXML, sockets, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xdebug, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zip, zlib.

# PHP Settings
max_execution_time - 60
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 512M
post_max_size - 20M
sql.safe_mode - Off
upload_max_filesize - 20M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
xdebug.max_nesting_level - 256
xdebug.max_stack_frames - -1
xdebug.var_display_max_children - -1
xdebug.var_display_max_data - -1
xdebug.var_display_max_depth - -1
opcache.max_accelerated_files - 10000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:58.0) Gecko/20100101 Firefox/58.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.