Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: 1 [2]   Go Down

Author Topic: PHP 7.0  (Read 3879 times)

0 Members and 1 Guest are viewing this topic.

maxhasher

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: PHP 7.0
« Reply #20 on: March 29, 2017, 06:50:57 PM »

I've pulled up an error
(Critical error  There was an error while processing a database query)
 in upload with 1.6.01 with basic details in the attached txt file.
No issue with the cpg Admin user but failure as a Registered user.
Not sure if it is caused by datetime ( as i had an issue of putting 0000-00-00 in a date field in my own tables as deprecated and also if there is an ordering issue that needs specifying for example Order by min(date)
I cant identify exactly at the moment but suspect mySQL 5.7 and strict as no issue on production server
Logged

maxhasher

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: PHP 7.0
« Reply #21 on: March 29, 2017, 07:34:32 PM »

Further to last :-
As I was on my local machine I followed some advice and added
disable_strict_mode.cnf
containing
[mysqld]
sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

to the /etc/mysql/conf.d/ folder

this allowed the registered user to upload.
I can't work out where the difference is between the admin and the registered user SQL settings in UPLOAD.PHP that would bar the reg user and not the admin by strict mode.
I would have thought it would be both or neither.
Logged

ron4mac

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Posts: 535
Re: PHP 7.0
« Reply #22 on: March 30, 2017, 01:31:56 AM »

I've pulled up an error
(Critical error  There was an error while processing a database query)
 in upload with 1.6.01 with basic details in the attached txt file.
No issue with the cpg Admin user but failure as a Registered user.

Thank you very much for providing good feedback. I created a fresh system (Linux) with PHP 7.0.15 and mysql 5.7.17.  I was able to see the problem that you described and was able to make coding corrections to prevent the error. The error stemmed from strict usage requirements of the sql DISTINCT keyword.

I have applied the corrections to the Github distribution.
Logged

maxhasher

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: PHP 7.0
« Reply #23 on: March 30, 2017, 02:11:46 PM »

Glad to help
Don't think it will be long before 1&1 update php to 5.7 but not sure where they will go with the mysql server. But better to engineer than to repair..
Logged

maxhasher

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: PHP 7.0
« Reply #24 on: March 31, 2017, 04:53:48 PM »

tested ok having just overwritten the january code with the march version.
Good going.
Long way down the code that.
I had a similar issue with not adding a field I was querying with.
Logged

maxhasher

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: PHP 7.0
« Reply #25 on: March 31, 2017, 07:10:22 PM »

Hi ron4mac Got another
In the new version of the code
On the home page it displays a link to the user galleries
Clicking this pulls up the page index.php?cat=1
and produces
Critical error
There was an error while processing a database query
Logged

ron4mac

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Posts: 535
Re: PHP 7.0
« Reply #26 on: March 31, 2017, 08:16:13 PM »

Okay ... thanks.

Fix is:
file bridge/udb_base.inc.php replace line 521
Code: [Select]
. "WHERE ((ISNULL(approved) OR approved='YES') AND category > " . FIRST_USER_CAT . ") $FORBIDDEN_SET GROUP BY user_id "
with
Code: [Select]
. "WHERE ((ISNULL(approved) OR approved='YES') AND category > " . FIRST_USER_CAT . ") $FORBIDDEN_SET GROUP BY category, user_id "

Max, it would be better if you could create 'issues' at the CPG 1.6 Github repository for any additional items that you may run across in your particular system setup.
Logged

maxhasher

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: PHP 7.0
« Reply #27 on: March 31, 2017, 08:20:15 PM »

ok thanks.

I'll do that then on git
Logged

maxhasher

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: PHP 7.0
« Reply #28 on: March 31, 2017, 08:24:12 PM »

works well..
Sorry, my testing background has kicked in  ;D
Logged

ron4mac

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Posts: 535
Re: PHP 7.0
« Reply #29 on: March 31, 2017, 09:54:39 PM »

Sorry, my testing background has kicked in  ;D

No sorry here ... your help is truly appreciated.
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.066 seconds with 20 queries.