Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renamed GalleryHasMedia to GalleryItem #948

Merged
merged 1 commit into from Jun 13, 2016
Merged

renamed GalleryHasMedia to GalleryItem #948

merged 1 commit into from Jun 13, 2016

Conversation

OskarStark
Copy link
Member

@OskarStark OskarStark commented Feb 14, 2016

Fixes #828

Changelog

### Changed
- Renamed `GalleryHasMedia` to `GalleryItem` and all controllers, interfaces and actions accordingly
- Renamed `setGalleryHasMedias` to `setGalleryItems` in `Gallery`
- Renamed `getGalleryHasMedias` to `getGalleryItems` in `Gallery`
- Renamed `addGalleryHasMedias` to `addGalleryItem` in `Gallery`
- Renamed `$galleryHasMedias` to `$galleryItems` in `Gallery`
- Renamed `GalleryHasMediaAdmin` to `GalleryItemAdmin`
- Renamed `$galleryHasMediaClass` to `$galleryItemClass` in `GalleryController`
- Renamed `getGalleryGaleryhasmediasAction` to `getGalleryGalleryItemAction` in `GalleryController`
- Renamed `postGalleryMediaGalleryhasmediaAction` to `postGalleryMediaGalleryItemAction` in `GalleryController`
- Renamed `handleWriteGalleryhasmedia` to `handleWriteGalleryItem` in `GalleryController`
- Renamed `putGalleryMediaGalleryhasmediaAction` to `putGalleryMediaGalleryItemAction` in `GalleryController`
- Renamed `deleteGalleryMediaGalleryhasmediaAction` to `deleteGalleryMediaGalleryItemAction` in `GalleryController`
- Changed route name from `sonata_media_api_form_gallery_has_media ` to `sonata_media_api_form_gallery_item`
- Renamed `GalleryHasMediaInterface` to `GalleryItemInterface`
- Renamed config key from `gallery_has_media` to `gallery_item` under `sonata_media.class`
- Renamed `BaseGalleryHasMedia` to `BaseGalleryItem`
- Renamed `ApiGalleryHasMediaType` to `ApiGalleryItemType`
- Changed `GalleryInterface` and renamed `setGalleryHasMedias`, `getGalleryHasMedias` and `addGalleryHasMedias` to `setGalleryItems`, `getGalleryItems` and `addGalleryItem`
- Renamed `reorderGalleryHasMedia` to `reorderGalleryItems` in `BaseGallery`
- Renamed `BaseGalleryHasMediaRepository` to `BaseGalleryItemRepository`
- Renamed `GalleryHasMediaRepository` to `GalleryItemRepository`
- Renamed `form.type` alias from `sonata_media_api_form_gallery_has_media` to `sonata_media_api_form_gallery_item`
- Renamed PHP files, skeletons and schema XML's accordingly to their class/entity names
- Renamed `Resources/config/serializer/Model.GalleryHasMedia.xml` to `Resources/config/serializer/Model.GalleryItem.xml`
- Renamed `translation keys from `form.label_gallery_has_medias` to `form.label.gallery_items`
- Changed `Resources/views/Gallery/view.html.twig`

Subject

This change is to huge to keep it BC, so i will schedule this for the next major release.

@sonata-project/contributors please review this change, thank you!

@OskarStark
Copy link
Member Author

Can we merge this in 3.1 ? @soullivaneuh

@OskarStark
Copy link
Member Author

ping @greg0ire can you please review?

'title' => $galleryItem->getMedia()->getName(),
'caption' => $galleryItem->getMedia()->getDescription(),
'type' => $type,
'media' => $galleryItem->getMedia(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we stop aligning things?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i rebased, but this is old and should then be fixxed by Style CI IMO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok fine :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mvhirsch
Copy link
Contributor

👍 for such a change, this will finally clarify what my $gallery->getGalleryHasMedias() (now $gallery->getGalleryItems()) is supposed to do


## GalleryHasMedia

The `GalleryHasMedia` has been renamed to `GalleryItem`, please adjust your code and be sure to move your assets to the correct database table.
Copy link
Contributor

@greg0ire greg0ire May 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gqq on this line with vim

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?? what do you mean? 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That it's too long. If you open the file with vim, and type 10Ggqq, it will be fixed :)

@greg0ire
Copy link
Contributor

Huge refactoring indeed! Congrats!

@soullivaneuh
Copy link
Member

soullivaneuh commented May 12, 2016

Can we merge this in 3.1 ? @soullivaneuh

Yes after I push 3.0. But it has to be BC.

@OskarStark
Copy link
Member Author

OskarStark commented May 12, 2016

Yes after I push 3.0. But it has to be BC.

then lets merge it in 4.0, this is a massive change, all classes needs to be handeld...

And i thought, because 3 is a new major, we can introduce BC breaks

@soullivaneuh
Copy link
Member

You rename the class GalleryHasMediaAdmin, why not simply keep it and mark it as deprecated?

@OskarStark
Copy link
Member Author

OskarStark commented May 13, 2016

Really? IMO we need to deprecate all (Api-)Controller classes too and maybe something else.

and i don't know what will happen if you upgrade and upgrade your schema, the new table name shouldn't match the new generated one, shouldn't it?

Wee need to keep the service name sonata.media.admin.gallery_has_media, too IMO

And the GalleryHasMediaAdmin, too

And the GalleryHasMediaInterface, too

@soullivaneuh
Copy link
Member

According to the new Sonata version management and next major release plan, this project has been refactored regarding branching and versioning.

If you see this message, your PR concerns a patch or a minor release and is not targeting the right branch.

So I'm closing this one, but don't see it as a refusal. If you think your work is still relevant and want to continue, feel free to reopen it on the right branch (e.g. the default one).

Regards.

@OskarStark
Copy link
Member Author

This is for the next major

@greg0ire
Copy link
Contributor

greg0ire commented Jun 8, 2016

Oh wait Travis has the same problems in fact : https://travis-ci.org/sonata-project/SonataMediaBundle/jobs/135807506#L623

@greg0ire
Copy link
Contributor

greg0ire commented Jun 8, 2016

So it must simply be that SonataCI is more strict --fail-on-warning config flag ? @rande @soullivaneuh

@SonataCI
Copy link
Collaborator

SonataCI commented Jun 9, 2016

Could you please rebase your PR and fix merge conflicts?

@OskarStark
Copy link
Member Author

rebased

@SonataCI
Copy link
Collaborator

Could you please rebase your PR and fix merge conflicts?

@OskarStark
Copy link
Member Author

rebased again!

Can we please merge this?

@greg0ire
Copy link
Contributor

Why is it marked as "in progress"?

@OskarStark
Copy link
Member Author

oops, sorry

## Renamed GalleryHasMedia to GalleryItem

All Actions, Controllers, Interfaces and anything related to this is renamed accordingly.
>>>>>>> renamed GalleryHasMedia to GalleryItem
Copy link
Contributor

@greg0ire greg0ire Jun 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh…

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oO

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@greg0ire greg0ire merged commit f7a6296 into sonata-project:master Jun 13, 2016
@greg0ire
Copy link
Contributor

Thanks for the huge work @OskarStark !

@OskarStark
Copy link
Member Author

Thanks for the huge work @OskarStark !

Thank you for your feedback @greg0ire 👍

@OskarStark OskarStark deleted the rename branch June 13, 2016 09:30
ksom pushed a commit to ksom/SonataMediaBundle that referenced this pull request Jun 27, 2016
@core23
Copy link
Member

core23 commented Jul 23, 2016

@OskarStark Is there a reason why we kept Modeel.GalleryHasMedia.xml?

@OskarStark
Copy link
Member Author

OskarStark commented Aug 1, 2016

not really, did i forget it?

  • Renamed serializer/Model.GalleryHasMedia.xml to serializer/Model.GalleryItem.xml

@core23
Copy link
Member

core23 commented Aug 1, 2016

The file still exists, I would say yes :trollface:

@OskarStark
Copy link
Member Author

OskarStark commented Aug 1, 2016

I created a PR here: #1094

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants