DBAL-936: Doctrine type not found exception thrown before checking the comment #2179

Closed
doctrinebot opened this Issue Jul 10, 2014 · 1 comment

3 participants

@doctrinebot

Jira issue originally created by user Nek:

Here is the piece of code:

$type = $this->_platform->getDoctrineTypeMapping($dbType);

// In cases where not connected to a database DESCRIBE $table does not return 'Comment'
if (isset($tableColumn['comment'])) {
    $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type);
    $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type);
}

The method getDoctrineTypeMapping throw an exception if the type is not found. But for example if you have an enum type (see the doctrine cookbook on the subject), the type is setted as comment.

Doctrine throw the exception before having the occasion to get the type via comment.

Here are two solutions:

  • Check for comment before throw the exception
  • Adding the enum type to the doctrine platform and mapping it to string
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
@beberlei beberlei was assigned by doctrinebot Dec 7, 2015
@deeky666 deeky666 assigned deeky666 and unassigned beberlei Jan 6, 2016
@deeky666 deeky666 added the Duplicate label Jan 6, 2016
@deeky666
Doctrine member

Duplicate of #1509

@deeky666 deeky666 closed this Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment