Make WordPress Core

Opened 7 weeks ago

Last modified 12 days ago

#60666 accepted defect (bug)

Unwanted section appears as a sidebar in 'Create gallery' section

Reported by: ukdrahul's profile ukdrahul Owned by: joedolson's profile joedolson
Milestone: 6.6 Priority: normal
Severity: normal Version: 5.0
Component: Media Keywords: changes-requested needs-testing
Focuses: javascript Cc:

Description

Unwanted section with 'Actions' and 'Create gallery' texts appear in the sidebar of Media Library and nothing happens on selection or click of the texts.

To find the issue, please go through the below steps.

1.From the 'File' block add the block 'Gallery', then select Media Library.
2.Unwanted sidebar section with the specified texts appears.

Attachments (1)

Unwanted section appears for gallery block.png (1.4 MB) - added by ukdrahul 7 weeks ago.
Unwanted sidebar appears for gallery block

Download all attachments as: .zip

Change History (5)

@ukdrahul
7 weeks ago

Unwanted sidebar appears for gallery block

#1 @ababir
7 weeks ago

I have seen the same issue for just the image block. Here is ticket #58973. It seems like this ticket was solved on 6.5. But it still exists for the 'Image Gallery' block.

#2 @joedolson
6 weeks ago

  • Focuses javascript added
  • Milestone changed from Awaiting Review to 6.6
  • Owner set to joedolson
  • Status changed from new to accepted
  • Version set to 5.0

It's appearing because it's showing the context of the gallery creation, but it is rather pointless, since it's the only option available. It doesn't do anything because there are no alternatives available.

Setting the version to 5.0 for now, I'm guessing this has existed since galleries showed up in the block editor, but I'll have to research that later.

This ticket was mentioned in Slack in #core-media by joedolson. View the logs.


6 weeks ago

#4 @ruchirj
12 days ago

  • Keywords changes-requested needs-testing added

Hello i just change the code and it's working for all block who have no action menu here is below,

before changes:



	_menu: function() {
		var menu = this.frame.menu,
			mode = this.get('menu'),
			actionMenuItems,
			actionMenuLength,
			view;

		if ( this.frame.menu ) {
			actionMenuItems = this.frame.menu.get('views'),
			actionMenuLength = actionMenuItems ? actionMenuItems.views.get().length : 0,
			// Show action menu only if it is active and has more than one default element.
			this.frame.$el.toggleClass( 'hide-menu', ! mode || actionMenuLength < 2 );
		}
		if ( ! mode ) {
			return;
		}

		menu.mode( mode );

		view = menu.get();
		if ( view && view.select ) {
			view.select( this.id );
		}
	},

and after changes :

	_menu: function() {
		var menu = this.frame.menu,
			mode = this.get('menu'),
			actionMenuItems,
			actionMenuLength,
			view,
            actionMenuItems = this.frame.menu.get('views'),
			actionMenuLength = actionMenuItems ? actionMenuItems.views.get().length : 0;

		if ( this.frame.menu ) {
			// Show action menu only if it is active and has more than one default element.
			this.frame.$el.toggleClass( 'hide-menu', ! mode || actionMenuLength < 2 );
		}
		if ( ! mode || actionMenuLength < 2) {
			return;
		}

		menu.mode( mode );

		view = menu.get();
		if ( view && view.select ) {
			view.select( this.id );
		}
	},

media-view.js
line 2282 to 2305.

Last edited 12 days ago by ruchirj (previous) (diff)
Note: See TracTickets for help on using tickets.