eckinox / tinymce-bundle

TinyMCE 6 integration for your Symfony apps and forms
MIT License
20 stars 2 forks source link

upload tab from local filesystem not showing #8

Open broomdancer opened 10 months ago

broomdancer commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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:

Hope that helps!

EmilePerron commented 1 month ago

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!