Uploaded image for project: 'Doctrine DBAL'
  1. Doctrine DBAL
  2. DBAL-936

Doctrine type not found exception thrown before checking the comment


    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.2
    • Fix Version/s: None
    • Component/s: Schema Managers
    • Security Level: All
    • Labels:


      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


        There are no comments yet on this issue.


          • Assignee:
            beberlei Benjamin Eberlei
            Nek Maxime Veber
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: