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

problem with context and media 2.4 #737

Closed
Arvi89 opened this issue Mar 22, 2015 · 7 comments
Closed

problem with context and media 2.4 #737

Arvi89 opened this issue Mar 22, 2015 · 7 comments

Comments

@Arvi89
Copy link

Arvi89 commented Mar 22, 2015

Hello,

I have installed media 2.4 (with admin 2.4, as well as formatter). All work fine except when, while using ckeditor, I decide to select a picture from the media list that is not in the default context.

So, I created 2 context, user and blog (and default is already here), it also created 2 categories with the same name (I tried to remove them but it crashed...).

When writing a blog, I tried to get a picture from the list, I have all from the default context, but when I select the blog context, it says there is nothing (but when I check the media list from the admin, I can see the pictures). And in the db, context is properly set to "blog" (why not ID from the db table btw?) and category has the ID of the blog category.

So I'll put all to default, but that's not optimal.

Here is my composer.json:
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.6.*",
"doctrine/orm": "~2.2,>=2.2.3,<2.5",
"doctrine/dbal": "<2.5",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~3.0,>=3.0.12",
"sensio/framework-extra-bundle": "~3.0,>=3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "~2.0@dev",
"sonata-project/block-bundle": "~2.3@dev",
"sonata-project/admin-bundle": "~2.4@dev",
"sonata-project/doctrine-orm-admin-bundle": "~2.4@dev",
"sonata-project/media-bundle": "dev-master",
"sonata-project/datagrid-bundle": "~2.2@dev",
"sonata-project/classification-bundle": "dev-master",
"sonata-project/intl-bundle": "~2.2",
"michelf/php-markdown": "~1.4.0",
"knplabs/knp-markdown-bundle": "dev-master",
"sonata-project/formatter-bundle": "dev-master"

@bdebon
Copy link

bdebon commented Mar 23, 2015

Same problem here... When I add a media in another context that the default one, the media is added (I can find it in my database) but I can't find it through the Media Admin...
Another strange thing is the behavior of "sonata_type_model_list" now. When you click on the Add btn, it opens a modal windows (not the same as before), you have to choose your media and set a Category. Why ? I have said that my context was "blog". Why must I also precise that the category is "blog".
I am a little bit lost with these new changes...

@Arvi89
Copy link
Author

Arvi89 commented Mar 24, 2015

I agree, the new system is super confusing, mixing between categories and context, and if I have a blog context, that doesn't mean I also want a blog category.

@lucasgranberg
Copy link

I agree. If I filter the context it persists a new category with the same name. Anything I put in the context filter is persisted into the category table. I suppose the idea was to create a root category for each context but that doesn't let anybody have media without categories. The logic there is not the most intiutive I think.

It is kind of redundant to spcify that a object is from context X with category X. Why not context X with category NULL? I suppose some of this "logic" comes from the classificationbundle.

@Arvi89
Copy link
Author

Arvi89 commented Mar 26, 2015

Yeah, and I think they got confused too actually, I just tried the sonata sandbox, even there it doesn't work... It's too bad, You guys are making great bundles, but you are adding too many things that are not needed (I'd love to use Sonata User for example, but why adding by default all the social crap?), and now with media all the classification stuff, only context was enough, now it doesn't work :(

@lucasgranberg
Copy link

For now I just overrode the MediaAdminControllers listAction and removed the category check. I also rolled my own version of the MediaAdmin:list.html.twig template.

@rande
Copy link
Member

rande commented Mar 26, 2015

@Arvi89 the social information does not cost that much if there are empty. Also you can define you own User class with your field. So there is a solution to remove them.

@lucasgranberg a media lib without organisation just make it very hard to use. From an end user point of view, folder is quite easy to understand. Now if you find some bugs in the UI, please feel free to send report or send PR. Please note, those features are not marked as stable as some issues are still presents.

We are fixing the integration with CKEditor (Formatter Bundle) and MediaBundle, so yes some weird behaviors might occurs.

Can you open individual issue in a dedicated ticket and explain how to reproduce the bug. Thanks

@rande rande closed this as completed Mar 26, 2015
@lucasgranberg
Copy link

I agree, this is not really the forum for discussing features, (and even other bundles).

As for the original issue the migration could probably be made smoother so that old medias would still work. I agree that it is important with organisation of your files but I don't agree with how it is done. Now the "folder tree" looks like:

  • default(context)
    • default(root category)
      • image1
      • image2
  • blog(context)
    • blog(root category)
      • image 3

Why can't the context just be the root category? Sometimes it does make sense to add images directly to the root if no categories are required.

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

No branches or pull requests

4 participants