Skip to content

Sorting migrations breaks listing them #1589

@mamazu

Description

@mamazu

Bug Report

Q A
BC Break no
Version 3.9.7

Summary

In doctrine you can sort the migrations. However enabling this sorting uses a different migration finder. This leads to the fact that if you enable sorting doctrine finds more migrations than if you don't.

Current behavior

If you list migrations in the sulu/sulu project by default it will use the GlobFinder to find migrations (classes) starting with "Version". This works fine. However when using the RecursiveRegexFilter (which gets enabled when switching on the sorting, in the doctrine bundle) then it returns all classes in the Migration directory. In this case this also includes an abstract base class or the migration called "AbstractTagNameToIdMigration" which is an abstract class and can not be instantiated.

How to reproduce

  • Create an abstract migration class that can not be instantiated
  • Name the class something like "AbstractMigrationVersion" or something not matching the naming scheme
  • See it getting picked up

Expected behavior

Make the regex finder also filter down to migrations matching "Version*" like in the glob filter. Or use the same Migration Finder for both and do the sorting afterwards.

More Infos

sulu/sulu#8874

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions