Problem/Motivation

When adding an image through the media dialogue window, the scheduler options are not being loaded. They are however being loaded on the "media/add/image"-page. scheduler options are enabled and the fields are also enabled on the media libraries form page.

The options do appear when using an external video.

Steps to reproduce

Open the media interface via Ckeditor and upload an image. The scheduler fields will not appear after the image has been uploaded.

Using drupal 9.4 / php 8.1

Issue fork scheduler-3291771

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

demon326 created an issue. See original summary.

jonathan1055 made their first commit to this issue’s fork.

jonathan1055’s picture

StatusFileSize
new146.44 KB
new120.02 KB

Hi @demon326,
Thanks for the info. I have investigated this, and I want to make sure I am doing the same as you:

  1. Enable the scheduling options for Image and Remote Video
  2. In Administration > Configuration > Content authoring, check which text formats use CK Editor. Default is Basic HTML and Full HTML
  3. Edit a page or article, and set the text format to Full HTML for example
  4. Click the 'insert image' icon
  5. This is where you are expecting the scheduler fields?

The screen shots you show are slightly different, so I'm not certain that the steps above are exactly what you are doing. I have added two of mine.

The reason the Scheduler fields do not show in my screen shots is because the form id is 'editor_image_dialog' and this is not catered for in the hook_form_alter processing. But your screen shot is not this form. So could you tell me your actual steps to this form?

demon326’s picture

The following video shows the problem. It shows that a external video gets the options, an image uploaded not.

The option do appear on media/add/image , but not when using the media librarie widget.

https://www.youtube.com/watch?v=p0pPED0iVwQ

Screenshots of settings are in the attachment of this issue.

jonathan1055’s picture

Title: scheduler options not being shown in media dialogue window with images » Scheduler date fields not being shown in media library window with images

Ah, now I can see you are using the Media Library module, and have customised the ckeditor toolbar to add the 'insert from media library' button and have enabled the 'embed media' filter.

This problem has already been found and discussed on Scheduler issue #2916730: Scheduler fields displayed in Media Library upload form when media is not enabled for scheduling. The problem is that the fields have to be hidden for all media types here because we cannot properly modify the form. There is no getFormDisplay() method. The fields should not be showing up for remote video either - the reason that they are is because that form id is 'media_library_add_form_oembed' whereas we only catered for 'media_library_add_form_upload' (which covers all the other media types). You will see if you disable scheduling for Remote Video that the fields still show up. This is why we have to remove them for all media types, as we can't accurately determine which fields should be shown, which are required, etc.

I have raised two core issues:
#3269103: Add getFormDisplay() method to media_library AddFormBase
#3269471: Expose 'published' status filter in media library views
If these get fixed then Scheduler can properly modify the media upload and oembed forms.

demon326’s picture

Thanks for taking your time and to get back at me! I tried searching the que before i created the issue, but did not found something. Now i can stop running in rounds looking for why those fields are not there. Lets hope core devs have some time to look at such little issue...

jonathan1055’s picture

I am not surprised that you didn't find the existing issue, as the subject was reporting the opposite problem. I think we need to make the remote video embed form behave in the same way - that was always the intension but I did not realise that the form id was different for that one.

If there is another way to get round this, before those core issues are done, then it would be good. I did investigate that last time, and did not find a way.

jonathan1055’s picture

Version: 2.0.0-rc4 » 2.x-dev
Status: Active » Needs review

  • jonathan1055 committed 4d43427 on 2.x
    Issue #3291771 by jonathan1055, demon326: Scheduler date fields not...
jonathan1055’s picture

Status: Needs review » Fixed
Related issues: +#2916730: Scheduler fields displayed in Media Library upload form when media is not enabled for scheduling

Merged and fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.