Opened 7 months ago
Last modified 10 days ago
#60666 reopened defect (bug)
Unwanted section appears as a sidebar in 'Create gallery' section
Reported by: | ukdrahul | Owned by: | joedolson |
---|---|---|---|
Milestone: | 6.7 | 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 (35)
#1
@
7 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
@
7 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.
7 months ago
#4
@
6 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.
4 months ago
This ticket was mentioned in Slack in #core by nhrrob. View the logs.
4 months ago
#8
@
4 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.
4 months ago
#10
Trac ticket: https://core.trac.wordpress.org/ticket/60666
#11
@
4 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
@
4 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
@
4 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
@
4 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
@
4 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
@
4 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
@
3 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
@
2 weeks 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
@
2 weeks 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:
11 days ago
#23
In r59139
This ticket was mentioned in Slack in #core by noisysocks. View the logs.
11 days ago
#25
@
11 days 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
@
11 days 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
@
11 days 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
@
10 days 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
@
10 days 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