Opened 10 months ago
Last modified 7 weeks ago
#60666 reopened defect (bug)
Unwanted section appears as a sidebar in 'Create gallery' section
Reported by: | ukdrahul | Owned by: | joedolson |
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | 5.0 |
Component: | Media | Keywords: | has-patch has-testing-info |
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 (4)
Change History (36)
#1
@
10 months 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
@
9 months 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.
9 months ago
#4
@
8 months 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.
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
6 months ago
This ticket was mentioned in Slack in #core by nhrrob. View the logs.
6 months ago
#8
@
6 months ago
- Keywords changes-requested removed
We have reviewed this in today's bug scrub.
Changes requested doesn't seem a valid keyword here.
Also a possible fix is given in https://core.trac.wordpress.org/ticket/60666#comment:4
Anyone wants to add a patch or PR?
This ticket was mentioned in PR #6878 on WordPress/wordpress-develop by @joedolson.
6 months ago
#10
Trac ticket: https://core.trac.wordpress.org/ticket/60666
#11
@
6 months ago
I'm not sure this patch works as described; at least, not as far as I can tell. However, the original testing instructions also don't entirely make sense to me: I'm not sure what "From the 'File' block add the block 'Gallery', then select Media Library." means.
@ukdrahul Are you able to clarify the instructions for reproducing the issue? I'm not clear what the File block has to do with this.
#12
@
6 months ago
Here are the steps to reproduce the issue:
- Create a new post/page.
- Select the Gallery block and click on the Media Library option.
- You will notice that the unwanted section appears in sidebar.
- Added Attachment for Reference.
#14
@
6 months ago
- Milestone changed from 6.6 to 6.7
We have RC1 and patch needs at least testing, so, I am moving it to the next milestone.
#15
in reply to:
↑ 9
@
6 months ago
Replying to joedolson:
Hey, trying to implement the patch (60666.diff) on a fresh install of 6.5 and 5.5. Can't find the file to patch (state.js) within the installation directory.
The given path is src/js/media/controllers/state.js . However searching for 'state.js' within the WordPress installation directory finds no such file.
Am I doing something wrong here?
#16
@
6 months ago
- Keywords needs-testing removed
Test Report
Description
I have added patch in my local and it is working fine - https://core.trac.wordpress.org/attachment/ticket/60666/60666.diff
Environment
- WordPress: 6.6-RC1-58573
- PHP: 8.1.23
- Server: nginx/1.16.0
- Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.23)
- Browser: Chrome 126.0.0.0 (macOS)
- Theme: Twenty Nineteen 2.8
Results
Before Patch
https://prnt.sc/PyELnbnvbjLe
After Patch
Screenshot - https://prnt.sc/5KT-Vx2Tch_l
Video - https://www.loom.com/share/71aacf85758543c386440e45254563d1?sid=6997c9ed-e284-4a97-bc4d-2042e994303e
#17
@
6 months ago
@joedolson As the testing went well (done by @sudipatel007 ), I was wondering if we could try to resolve this minor bug in version 6.6 and finalize it. Would that be possible?
#18
@
6 months ago
@rsiddiqe You need to apply patches to the WordPress src
directory; if you don't have a state.js
file, then you're looking at a copy of WordPress that's already been built.
@ukdrahul No, now that we're in the release candidate phase nothing can be committed that isn't an issue introduced during the 6.6 cycle.
#19
@
3 months ago
- Keywords has-testing-info added
Test Report
Description
I have applied the https://core.trac.wordpress.org/attachment/ticket/60666/60666.diff patch locally, and it is functioning as expected.
Environment
WordPress: 6.6
PHP: 8.2.12
Server: apache
Browser: Chrome 129.0.6668.58
Theme: Twenty Twenty
Results
The patch is working as expected.
#20
@
3 months ago
Test Report
Description
I have added patch in my local and it is working fine - https://core.trac.wordpress.org/attachment/ticket/60666/60666.diff
Environment
- WordPress: 6.7-alpha-59086
- PHP: 8.2.23
- Server: Apache/2.4.62 (Debian)
- Database: mysqli (Server: 11.5.2-MariaDB-ubu2404 / Client: mysqlnd 8.2.23)
- Browser: Chrome 129.0.0.0 (macOS)
- Theme: Twenty Twenty-Four 1.2
- MU-Plugins: None activated
- Plugins:
- WordPress Beta Tester 3.5.6
Results
Before Patch
https://prnt.sc/Tgsj29KObflW
After Patch
https://prnt.sc/mHoytwiCmvwu
@joedolson commented on PR #6878:
2 months ago
#23
In r59139
This ticket was mentioned in Slack in #core by noisysocks. View the logs.
2 months ago
#25
@
2 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
The tests in the Gutenberg repo have picked up an error with this as the left sidebar is no longer displayed when inserting media within the classic block.
See https://github.com/WordPress/gutenberg/actions/runs/11116072767/job/30885672515
Reopening for follow-up.
#26
@
2 months ago
The tests in the Gutenberg repo have picked up an error with this as the left sidebar is no longer displayed when inserting media within the classic block.
Can confirm. Not sure what the fix is. Is it possible from within the media controller to know if it's been activated by a classic block?
#27
@
2 months ago
Yeah, this has over-reached, and it's impacting cases beyond what it should. May need to revert; but I'll explore further tomorrow.
#28
@
2 months ago
Came here because I noticed a seemingly related problem in the media library itself. Clicking on attachments in gallery view has no effect. I tried the commit prior to this change and everything seemed to work great.
#29
@
2 months ago
I'm going to revert this; while it is doing what it says it'll do, it's *also* doing a lot of other things.
I haven't been able to reproduce what you're describing, though @desrosj. Can you be specific about what environment you're using?
Unwanted sidebar appears for gallery block