Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2015-12-17 17:55:06

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Errors on clean install on localhost.

Edit the file textpattern/lib/txplib_db.php. Search for the line that reads (should be around line 47):

mysql_query("SET NAMES ". $txpcfg['dbcharset']);

Just below that line, add the following line:

mysql_query("SET SESSION sql_mode = ''");

Does that fix the problem for existing installs?

For new installs, you’d also have to edit textpattern/setup/txpsql.php, search for the line that reads (should be around line 34):

mysql_query("SET NAMES ".$dbcharset);

And add that SET SESSION line below there as well.

Let us know if this solves the problem.

Offline

#14 2015-12-18 08:30:53

bulldog
New Member
Registered: 2015-12-15
Posts: 5

Re: Errors on clean install on localhost.

Existing installs

Save articles works well. It does not change the functional behavior to add another language (Preferences). By click on Install it says Preferences saved but the link shows further Update and remains active.

Clean install

All the Textpattern CMS database tables were created and populated.

Then I went to Textpattern login page. After login I get following JavaScript error popup:

Internal error “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ignore table `textpattern` add index section_status_idx (Section,Status)’ at line 1”.

Then the page shows:

I’m sorry. I’m afraid I can’t do that; article is an unsafe operation.

Offline

#15 2015-12-20 18:55:31

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Errors on clean install on localhost.

I’ve done some tests with MariaDB 10.1 (can’t get MySQL 5.7 to install on the debian/ubuntu versions I’m running), combined with PHP 7 and what is to become TXP 4.6 with the two proposed modified lines to unset the SQL mode.

For a new install that solved the errors I got during setup and after the initial login. I didn’t test upgrading an existing install.

@bulldog, I’m not sure what you mean by “byt the link shows further update and remains active”.

@bulldog, could you try grabbing the development version of TXP via GIT, add the two SET SQL MODE lines and then do a clean install to see if that causes errors as well, because this probably won’t be fixed for the TXP 4.5.x branch and the 4.6.x branch shouldn’t have that error (which seems unrelated and I can’t explain it).

Offline

#16 2015-12-23 11:45:53

bulldog
New Member
Registered: 2015-12-15
Posts: 5

Re: Errors on clean install on localhost.

@ruud, after a language is installed, the (Install)link shows further Update and is clickable (active). Normally, after install or update language, there is no link, just text that says »updated«. You know what I mean?

@ruud, the development version of TXP via GIT (4.6-dev) doesn’t have the lines you mentioned, so I don’t know where I have to add the two SET SQL MODE lines.

Offline

#17 2015-12-23 16:37:54

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Errors on clean install on localhost.

The line numbers are perhaps a bit different, but those lines are there.

I tried installing a language and for me it showed ‘updated’, so I can’t reproduce that.

Offline

#18 2015-12-24 11:56:43

bulldog
New Member
Registered: 2015-12-15
Posts: 5

Re: Errors on clean install on localhost.

The issue about the Update languages was related on a missing timezone setting in php.ini. Once I configure this it works well. Sorry, my fault.

But no, the lines you are mentioned are not one-to-one there. OK, I have to dig a little bit deeper ;o)

I edit the file textpattern/lib/txplib_db.php around line 218:

mysqli_query($this->link, "SET NAMES ".$this->charset);

Just below that line, I add the following line:

mysqli_query($this->link, "SET SESSION sql_mode = ''");

Also I edit textpattern/setup/txpsql.php around line 79 that reads:

mysqli_query($link, "SET NAMES ".$dbcharset);

And add the SET SESSION line below as follow:

mysqli_query($link, "SET SESSION sql_mode = ''");

This solves all problems and the installation works without any errors.

Merry Christmas @ all

Offline

Board footer

Powered by FluxBB