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

upload tab from local filesystem not showing #8

Open
broomdancer opened this issue Aug 19, 2023 · 4 comments
Open

upload tab from local filesystem not showing #8

broomdancer opened this issue Aug 19, 2023 · 4 comments

Comments

@broomdancer
Copy link

First of all: wonderful bundle! Impeccable!

I faced an issue not seeing this little upload button, when clicking the image dialog. The setting images_upload_url in tinymce.yaml is existing and set.

Can you help out?

@EmilePerron
Copy link
Collaborator

EmilePerron commented Aug 19, 2023

Hey @broomdancer!

Could you share the contents of your tinymce.yaml config file, and perhaps the relevant parts of your FormType code?

I’ll try and reproduce the issue on my end to see what’s wrong.

@broomdancer
Copy link
Author

Thank you for the quick response!

contens of tinymce.yaml

tinymce:
  images_upload_url: "http://127.0.0.1:8000/admin/tinymce/upload"
  images_upload_route: "" # Pame of the route for `images_upload_url` (leave `images_upload_url` blank if using this)
  images_upload_route_params: [] # Parameters of the route for `images_upload_url` (leave `images_upload_url` blank if using this)
  images_upload_handler: ""
  images_upload_base_path: ""
  images_upload_credentials: "true"
  images_reuse_filename: ""

From the error message I get the allowed settings:
Available options are "content_css", "images_reuse_filename", "images_upload_base_path", "images_upload_credentials", "images_upload_handler", "images_upload_route", "images_upload_route_params", "images_upload_url", "plugins", "skin", "toolbar"

Important part of the the formType:

$builder->add('content', TinymceType::class, [
    'label' => 'general.content',
    'attr' => [
        'plugins' => 'advlist autolink lists link image charmap preview anchor searchreplace visualblocks code fullscreen insertdatetime media table emoticons template image',
        'toolbar' => 'searchreplace | fullscreen | undo redo | styleselect | fontsizeselect | bold italic underline forecolor backcolor | link media image anchor code | codesample | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat',
        'image_uploadtab' => true

@EmilePerron
Copy link
Collaborator

Hey @broomdancer!

Just I just tested it out on my end and found the issue.

It seems the global defaults defined in tinymce.yaml are not used when attr is defined in the form type.

This seems like an oversight - my bad! I'll see if I can submit a PR to fix that issue soon (unless someone over at @eckinox has time to do it).

In the meantime, you can either:

  • Define your TinyMCE configs entirely in your config file, and not use attr in your TinymceType definition.
  • Specify all of your configs in your TinymceType definition.

Hope that helps!

@EmilePerron
Copy link
Collaborator

Hey @broomdancer

I just created a new fork of this repo with some bugfixes and improvements, so I'd suggest moving over to this new forked bundle: https://github.com/EmilePerron/tinymce-bundle

This issue should be fixed in this new fork.

Cheers!

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

2 participants