Fixtures order when using symlinks. (in 1.2) #257

Closed
pimpreneil opened this Issue Dec 2, 2013 · 0 comments

Projects

None yet

1 participant

@pimpreneil
Contributor

When loading fixtures that contain symlinks, the files order is not conserved.

Let's say that we have two fixtures directory:

  • "fixtures" with the main fixtures
  • "secondary-fixtures" with the main fixtures (linked by symlinks) plus some additional fixtures.

When loading secondary-fixtures, symfony's Finder will base itself on the real path to sort the files, thus the file order won't be kept.

0 - PathName: app/propel/secondary-fixtures/10-authors.yml, RealPath: app/propel/fixtures/10-authors.yml
1 - PathName: app/propel/secondary-fixtures/00-books.yml, RealPath: app/propel/secondary-fixtures/00-books.yml

As you can see, even if the authors fixtures is weighted with a higher number, the Finder's sortByName method will firstly base itself on the real folder name.

I am not proposing any PR for the moment as I don't know if you really consider this issue as a bug or if you think it is more like a misuse of the fixtures on my side.
If you consider that is is indeed an issue, a simple fix would be to add a custom filter to the Finder's request that compares the PathName instead of the RealPath.

Thanks for your help 😃

@havvg havvg closed this in 0ce540c Dec 3, 2015
@Big-Shark Big-Shark added a commit to Big-Shark/PropelBundle that referenced this issue Feb 14, 2016
@pimpreneil @Big-Shark pimpreneil + Big-Shark Fix #257 - Prevent symlink paths resolving in fixtures loading d893e8a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment