Skip to content

Loading…

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

Closed
doctrinebot opened this Issue · 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
@beberlei beberlei was assigned by doctrinebot
@beberlei beberlei was unassigned by deeky666
@deeky666 deeky666 self-assigned this
@deeky666 deeky666 added the Duplicate label
@deeky666
Doctrine member

Duplicate of #1509

@deeky666 deeky666 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.