I tried Drupal with php 5.4.0 built in webserver.
I take a following steps:
git clone --branch 8.x http://git.drupal.org/project/drupal.git
cd drupal
Use PHP bulit in webserver:
/usr/local/bin/php -S localhost:9999
go browser: localhost:9999/install.php
use minimal profile and SQLite
I got a following errors:
Warning: Illegal string offset 'field' in Drupal\Core\Database\Driver\sqlite\Update->removeFieldsInCondition() (line 37 of /Users/pp/Work/temp/drupal/core/lib/Drupal/Core/Database/Driver/sqlite/Update.php).
Warning: Illegal string offset 'field' in Drupal\Core\Database\Driver\sqlite\Update->removeFieldsInCondition() (line 41 of /Users/pp/Work/temp/drupal/core/lib/Drupal/Core/Database/Driver/sqlite/Update.php).
Comment | File | Size | Author |
---|---|---|---|
#23 | 1542186-sqlite.patch | 645 bytes | droplet |
#7 | illegal_string_offset-1542186-7.patch | 965 bytes | rickmanelius |
#5 | patch.diff | 1.16 KB | redcell |
#1 | illegal_string_offset-1542186-1.patch | 1.12 KB | pp |
Comments
Comment #1
pp CreditAttribution: pp commentedI made a patch, which resolve this issue.
Comment #2
tommalia@tandtdatasolutions.com CreditAttribution: tommalia@tandtdatasolutions.com commentedSorry for the new-bee question... but how do you install the patch?
If it matters, my environment is Windows 7 with Apache 2.2 and PHP 5.4.3.
Comment #3
pp CreditAttribution: pp commentedUse Git and see "Applying a patch section" in the project page.
Comment #4
Ballistic_Weasel CreditAttribution: Ballistic_Weasel commented#1: illegal_string_offset-1542186-1.patch queued for re-testing.
Comment #5
redcell CreditAttribution: redcell commentedThis issue occurs during a fresh installation. I just performed a fresh install and I get this error.
Also, the patch does not completely fix the issue in 7.15. See attached.
Comment #7
rickmanelius CreditAttribution: rickmanelius commented#1 actually does work for Drupal 7.15. It reduces the number of errors on installation from 30+ down to 4, and it actually allows the installation to complete versus a aborting the process altogether. Unfortunately the patches in #1 and #5 are for Drupal 8 (e.g. using the core folder), so this version is for Drupal 7.
If we need to have the D8 submission accepted first, so be it... but this is a major ticket for sqllite users on D7 as you essentially cannot install Drupal without this patch. I'd like to push higher to critical but I know that mysql is the dominant database used in the community.
Comment #8
marcingy CreditAttribution: marcingy commentedComment #9
rickmanelius CreditAttribution: rickmanelius commentedBecause this has to be addressed in D8 before being backported to D7, this is a review of patch #1 using the current branch of D8 on an OS X MAMP stack using php 5.4.4 with the standard installation profile and SQLlite. I'm not using the built in php server, but that's not relevant from my end because I was able to demonstrate that the installation fails with the same errors using apache 2.2.x.
After applying #1 with D8 standard profile + sqllite on php 5.4.4, the installation now works with no visible errors to the user. I'm marking RBTC. Patch #7 (re-rolled against D7) will be reviewed after this is successfully committed to the D8 core.
Comment #10
webchickThanks for the fix! Could someone quickly verify that these errors do not appear on MySQL or some other database platform? In other words, is it correct that this is a SQLite only fix?
Comment #11
rickmanelius CreditAttribution: rickmanelius commentedHi @webchick,
I just applied and ran patch #1 against the most up to date version of D8 and can confirm that #1 does not introduce errors into a mysql installation... and a mysql installation works regardless of this patch or not. Also, because the scope of the patch in #1 is limited to a single function for the sqlite drivers, I don't think it would conflict.
When #1 gets accepted, I'd be pumped to see my D7 port in #7 also get accepted (pretty please with a cherry on top?) :) Drush quick-core-install is pretty much useless with this SQLite bug.
Comment #12
webchickOk, awesome. Thanks for the confirmation. :D We currently have a testbot backlog, so I'm not going to commit this just yet, but will take a look at it tonight. Thanks!
Comment #13
steinmb CreditAttribution: steinmb commentedTest env:
PHP 5.4.5
PostgreSQL 9.14
Install perfect with or without #1, RTBC from me.
Comment #14
catchLooks good to me, just a straight error in the sqlite driver. Committed/pushed to 8.x.
Comment #15
catchThere's already a 7.x patch here..
Comment #16
webchickCommitted and pushed to 7.x, too. Thanks!
Comment #17
rickmanelius CreditAttribution: rickmanelius commentedYAY!!!! Thanks for both the D7 and D8 commits :) Cheers!
Comment #19
znerol CreditAttribution: znerol commentedI kindly request to roll back this patch in 7.x as well as 8.x and instead go for the solution proposed in #1266572: Workaround in UpdateQuery_sqlite for affected rows count causes certain updates to be suppressed.
Comment #20
tim.plunkettI'm not convinced that is a better fix, or even related. Please follow-up in the other issue.
Comment #21
znerol CreditAttribution: znerol commentedI think we really have to revisit this patch. Not only because it blocks the other issue but also because it does not solve the reported issue in the first place. It also does not have anything to do with PHP 5.4 but just with having
error_reporting = E_ALL
in php.ini.I have:
And nevertheless I get:
Please revert this patch and then help me fix the real cause of that headache in the other one.
Comment #22
mc_vasja CreditAttribution: mc_vasja commented#5: patch.diff queued for re-testing.
Comment #23
droplet CreditAttribution: droplet commentedquick fix.
(the sqlite test system is broken: #1787004: [SQLite] Can't run tests )
Comment #24
znerol CreditAttribution: znerol commentedI don't think that testing this patch on the MySQL testbot is very usefull. The changes apply to the SQLite driver exclusively.
Comment #25
ParisLiakos CreditAttribution: ParisLiakos commenteddoes not seem major to me
Comment #26
droplet CreditAttribution: droplet commented@znerol,
You can download the patch and test it.
Comment #27
znerol CreditAttribution: znerol commentedLike I mentioned in #19, I'd rather advise to revert the changes introduced here and instead remove the entire
removeFieldsInCondition
method (as suggested by its original author Damien Tournoud). This would resolve this issues as well as #1266572: Workaround in UpdateQuery_sqlite for affected rows count causes certain updates to be suppressed.IMHO it is useless to patch
removeFieldsInCondition
if it should be removed entirely.Comment #28
webchickIn Drupal 7 at least, we cannot just rip out methods, though.
Comment #29
znerol CreditAttribution: znerol commented@webchick: I know that we cannot change API in minor versions. However
removeFieldsInCondition
is a protected method of the classUpdateQuery_sqlite
. This class is only loaded when sqlite is choosen as the database backend. The method was introduced by Damien but he "[... does] not remember why [he] did this in the first place, and it indeed looks very wrong.". As demonstrated in the other issue, this method leads to data corruption when only the primary key of an entity changes. There is also a test case in the patch of the other issue demonstrating the mechanism as well as detailed instructions on how to reproduce the problem.Regrettably the "fix" introduced in this issue - which does actually not fix the reported warnings, at least not in the version it was commited - conflicts with the solution we propose in #1266572: Workaround in UpdateQuery_sqlite for affected rows count causes certain updates to be suppressed.
I suggest that we split up the discussion as follows.
Comment #30
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis (private) method is completely unnecessary, it should just be removed. Let's move forward on removing it in #1266572: Workaround in UpdateQuery_sqlite for affected rows count causes certain updates to be suppressed.
Comment #31
David_Rothstein CreditAttribution: David_Rothstein commentedI'm not sure about anything else, but I can guarantee that the Drupal 7 patch was broken:
This cannot possibly be correct (it looks like a bad copy-paste job from the Drupal 8 patch).
I'm not quite sure what the consequences are, but don't really want to find out in a point release either.
Therefore, I've rolled this patch back in Drupal 7: http://drupalcode.org/project/drupal.git/commit/6b11350d32b753a45f481432...
Tentatively setting this back to needs work (for Drupal 7), though if we're removing the method in Drupal 7 also (rather than trying to fix it again), feel free to close this again as a duplicate.
Comment #32
dcrocks CreditAttribution: dcrocks commentedOn the advice in #31 and since nothing is moving forward on either issue I'm closing this one as a dup of #1266572: Workaround in UpdateQuery_sqlite for affected rows count causes certain updates to be suppressed
Comment #32.0
dcrocks CreditAttribution: dcrocks commentedUpdated issue summary.