In SelectQuery::preExecute() alter queries are called only if $this->alterTags is set.

This makes sense for hook_query_TAG_alter() implementations, but main hook_query_alter() implementations should be called regardless of whether any alterTags have been defined or not.

Patch to follow.

Comments

maciej.zgadzaj’s picture

Status: Active » Needs review
StatusFileSize
new659 bytes

Patch attached.

Status: Needs review » Needs work

The last submitted patch, 1: drupal-alter_with_no_altertags_2348555-1.patch, failed testing.

maciej.zgadzaj’s picture

Status: Needs work » Needs review
StatusFileSize
new644 bytes

Take 2, let's check if function exists before calling it.

poker10’s picture

Status: Needs review » Closed (won't fix)
Related issues: +#619580: Only invoke query_alter on tagged queries

This seems to be done on purpose, because of performance reasons, see: #619580: Only invoke query_alter on tagged queries . I think this should be won't fix. But feel free to reopen if you think otherwise.