Bug #24582

Accept alternative notations for setDBinit

Added by Steffen Gebert over 8 years ago. Updated 12 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-01-15
Due date:
% Done:

100%

TYPO3 Version:
6.1
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The error messages and deprecation log entries could be improved.

E.g.

This TYPO3 installation is using the $TYPO3_CONF_VARS['SYS']['setDBinit'] property with the following value:
SET NAMES 'utf-8'
It looks like UTF-8 is not used for this connection.
Everything other than UTF-8 is deprecated since TYPO3 4.5.

So please tell me, WHAT you expect! (it's SET NAMES utf8 without the quotes and hyphen (dunno how this got into my config.. ;-))

(issue imported from #M17046)

17046.diff View (1.41 KB) Administrator Admin, 2011-01-15 00:12


Related issues

Related to TYPO3 Core - Bug #24160: UTF-8 by default: Message on upgraded version should be styled and should tell what the problem is Rejected 2010-11-22
Related to TYPO3 Core - Feature #18501: Enable UTF-8 by default Closed 2008-03-26
Related to TYPO3 Core - Bug #24968: Pagetree inline editing produces wrong characters with special chars and without forceCharset=utf-8 Closed 2011-02-05
Related to TYPO3 Core - Bug #41596: Content of $TYPO3_CONF_VARS['SYS']['setDBinit'] is completely overruled / ignored Closed 2012-10-04

Associated revisions

Revision 96e325cd (diff)
Added by Michael Stucki over 6 years ago

[BUGFIX] Accept alternative notations for setDBinit

Allow quotes and upper-case notation when checking if
$TYPO3_CONF_VARS['SYS']['setDBinit'] is configured properly.

Resolves: #24582
Releases: 6.1, 6.0
Change-Id: I51a5f6cf363077c738656c207648f21d726de72b
Reviewed-on: https://review.typo3.org/19034
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

Revision 3d643295 (diff)
Added by Michael Stucki over 6 years ago

[BUGFIX] Accept alternative notations for setDBinit

Allow quotes and upper-case notation when checking if
$TYPO3_CONF_VARS['SYS']['setDBinit'] is configured properly.

Resolves: #24582
Releases: 6.1, 6.0
Change-Id: I51a5f6cf363077c738656c207648f21d726de72b
Reviewed-on: https://review.typo3.org/19035
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Markus Klein
Reviewed-by: Oliver Hader

History

#1 Updated by Steffen Gebert over 8 years ago

Need feedback from Benni for the Upgrade Wizard thingy

#2 Updated by Michael Stucki over 8 years ago

Sounds to me like the line with "SET NAMES utf8" was not recognized correctly.

#3 Updated by Steffen Gebert over 8 years ago

It's because of this check:

!preg_match('/SET NAMES utf8/', $TYPO3_CONF_VARS['SYS']['setDBinit'])

Quotes are not accepted..

#4 Updated by Steffen Gebert over 8 years ago

Another point, which should be improved is the comment for $TYPO3_CONF_VARS['BE']['forceCharset']

This option is deprecated since TYPO3 4.5,  and will be removed in 4.7. Please use proper tools to set your installation to native UTF-8.

Setting the value to an empty string in the Install Tool results in putting a line

$TYPO3_CONF_VARS['BE']['forceCharset'] = '';
into localconf.php (see #24968).
This overwrites the default value of -1. So removing the value from the input field and assuming that then the default is used is not true.

I would state
" -1 is the default value. Set it to -1 or utf-8, which both results in using utf-8, every other setting is deprecated."

#5 Updated by Kurt Gusbeth over 8 years ago

You should use the i-option too:
!preg_match('/SET NAMES utf8/i', $TYPO3_CONF_VARS['SYS']['setDBinit'])

#6 Updated by Peter Kuehn over 6 years ago

  • Target version deleted (0)

You should use the i-option too:
!preg_match('/SET NAMES utf8/i', $TYPO3_CONF_VARS['SYS']['setDBinit'])

+1 for Kurts point - would have saved me an hour today not to chase a loged problem that was none ;)

#7 Updated by Michael Stucki over 6 years ago

  • Subject changed from Improve non-UTF8 deprecation log entries / messages to Accept alternative notations for setDBinit
  • TYPO3 Version set to 6.1

#8 Updated by Gerrit Code Review over 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19034

#9 Updated by Gerrit Code Review over 6 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/19035

#10 Updated by Markus Klein over 6 years ago

Please also have a look at #41596.

#11 Updated by Gerrit Code Review over 6 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19034

#12 Updated by Gerrit Code Review over 6 years ago

Patch set 2 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/19035

#13 Updated by Gerrit Code Review over 6 years ago

Patch set 3 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/19035

#14 Updated by Michael Stucki over 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#15 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF