Download & Extend

Illegal string offset 'field' in function TaxonomyTermController->buildQuery()

Project:Drupal core
Version:7.x-dev
Component:taxonomy.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:needs backport to D7, PHP 5.4

Issue Summary

This warning is appearing when saving node. PHP 5.4.
My patch is attached.

AttachmentSizeStatusTest resultOperations
taxonomy.patch719 bytesIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch taxonomy_2.patch. Unable to apply patch. See the log in the details link for more information.View details

Comments

#1

Status:active» needs review

#2

Tagged as PHP 5.4 issue.

#3

It works.

#4

Works here as well. Drupal 7.14 and PHP 5.4.2.

#5

Status:needs review» reviewed & tested by the community

#6

Version:7.12» 8.x-dev
Status:reviewed & tested by the community» needs work
Issue tags:+needs backport to D7

Thanks for working on this issue. However, there are a few process problems with: a) It is customary not to RTBC your issue however as others reviewed it and it's quite simple, that's fine b) in order to make sure we do not regress bugs are first fixed in Drupal 8. That's more of a problem. A c) would be to add tests but I am not too keen on demanding a test for every isset() in core.

#7

Status:needs work» needs review

This is really due to the #conjunction key in the return array of $query->conditions() being a string, not because field is not set.

It would be nice if Drupal\Core\Database\Query\Condition implemented the Iterator interface, that way we could iterate over this cleanly and provide another method to access #conjunction. That would also allow us to get rid of the return-by-reference.

AttachmentSizeStatusTest resultOperations
taxonomy-illegal-string-offset-1525138-7.patch848 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 36,693 pass(es).View details

#8

taxonomy.patch queued for re-testing.

#9

Status:needs review» reviewed & tested by the community

Let's do it. See #6 for reasoning on not having a test.

#10

Version:8.x-dev» 7.x-dev
Status:reviewed & tested by the community» patch (to be ported)

Committed to 8.x. Thanks!

Moving to 7.x.

#11

Status:patch (to be ported)» needs review

Trivial re-roll.

AttachmentSizeStatusTest resultOperations
taxonomy-illegal-string-offset-1525138-11.patch711 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 39,245 pass(es).View details

#12

Status:needs review» reviewed & tested by the community

#13

Status:reviewed & tested by the community» fixed

Eh, silly PHP... I wish we could have gone with the original patch here, since isset() is more self-documenting, but PHP can return TRUE for that even when it's a string, so yeah, I think the newer one works better.

Committed to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/2c7f509

#14

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.