DDC-1091: Parser::FunctionsReturningStrings() doesn't check for custom DQL functions. #1363

Closed
opened 2026-01-22 13:11:53 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Mar 31, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user iksela:

I defined a custom DQL FunctionNode that wasn't detected by the Parser.
Problem was in the Parser::FunctionsReturningStrings(), but I suspect the problem is more general.

Here's my (ugly) fix:

public function FunctionsReturningStrings()
{
$funcNameLower = strtolower($this->_lexer->lookahead['value']);
if (isset(self::$_STRING_FUNCTIONS[$funcNameLower])) {
$funcClass = self::$_STRING_FUNCTIONS[$funcNameLower];
$function = new $funcClass($funcNameLower);
$function->parse($this);
}
else $function = $this->CustomFunctionsReturningStrings();

    return $function;
}

I include the custom DQL FunctionNode created.

Originally created by @doctrinebot on GitHub (Mar 31, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user iksela: I defined a custom DQL FunctionNode that wasn't detected by the Parser. Problem was in the Parser::FunctionsReturningStrings(), but I suspect the problem is more general. Here's my (ugly) fix: public function FunctionsReturningStrings() { $funcNameLower = strtolower($this->_lexer->lookahead['value']); if (isset(self::$_STRING_FUNCTIONS[$funcNameLower])) { $funcClass = self::$_STRING_FUNCTIONS[$funcNameLower]; $function = new $funcClass($funcNameLower); $function->parse($this); } else $function = $this->CustomFunctionsReturningStrings(); ``` return $function; } ``` I include the custom DQL FunctionNode created.
admin added the Bug label 2026-01-22 13:11:53 +01:00
admin closed this issue 2026-01-22 13:11:53 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 1, 2011):

Comment created by @beberlei:

Fixed

@doctrinebot commented on GitHub (May 1, 2011): Comment created by @beberlei: Fixed
Author
Owner

@doctrinebot commented on GitHub (May 1, 2011):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (May 1, 2011): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2015):

Imported 1 attachments from Jira into https://gist.github.com/af75b56e37ac54349a45

@doctrinebot commented on GitHub (Dec 13, 2015): Imported 1 attachments from Jira into https://gist.github.com/af75b56e37ac54349a45 - [10964_bDqlNvl.php](https://gist.github.com/af75b56e37ac54349a45#file-10964_bDqlNvl-php)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1363