Page MenuHomePhabricator

[Regression?] Re-use reference option appears enabled in the Cite inspector inside Media/Gallery dialog in Beta Cluster
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Open any page on Beta cluster within VE.
  2. Go to Insert>Images and Media.
  3. Click on the Cite option on the Media dialog toolbar.
  4. Observe that the "Re-use" option is enabled within the inspector which is different from production where it stays disabled.
  5. Choose any of the existing references to Re-Use.

Observed Result:
An error appears in the console and the caption text field becomes un-scrollable.
jQuery.Deferred exception: Cannot read properties of undefined (reading 'getChildren')

Expected Result: I am not sure, is the Re-use button supposed to be disabled in Beta cluster for these dialogs as it is in production?

Screenshot/Screen capture:

ProductionBeta Cluster
Screenshot 2024-09-04 at 4.14.01 PM.png (1,006×1,054 px, 114 KB)
Screenshot 2024-09-04 at 4.14.28 PM.png (1,078×1,066 px, 150 KB)
Screenshot 2024-09-04 at 4.14.54 PM.png (2,862×1,706 px, 872 KB)

Browser: Chrome

Environment: Beta cluster.

Event Timeline

Ryasmeen renamed this task from [Regression?] Re-use reference option appears enabled in the Cite inspector inside Media/Gallary dialog in Beta Cluster to [Regression?] Re-use reference option appears enabled in the Cite inspector inside Media/Gallery dialog in Beta Cluster.Sep 4 2024, 11:54 PM
Ryasmeen updated the task description. (Show Details)

At the moment, I cannot reproduce this locally. The reuse tab stays disabled when I try it. The beta cluster is unreachable as of now, unfortunately.

I added this to our sprint and will try again tomorrow. Thanks a lot for bringing this to our attention! Luckily it seems to be extremely low risk, possibly even limited to the beta cluster only.

Change #1070978 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] Add extra safe-guard to ve.ui.MWCitationDialogTool

https://gerrit.wikimedia.org/r/1070978

Locally, I see the issue that the reuse and extends tabs are still available. This was a mistake and is caused by the data source for those dialogs now coming from the full document and not only the caption fragment. (When no citations can be reused, the tabs are disabled.) Unfortunately, the reuse would be desirable but is not fully supported, see T336417: Reusing references inside and from a VE image/gallery dialog.

I don't see the console error, with or without the patch attached to this ticket.

We should disable the tabs for now.

Change #1070978 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Add extra safe-guard to ve.ui.MWCitationDialogTool

https://gerrit.wikimedia.org/r/1070978

Change #1071826 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/Cite@master] Try to always limit our document references to the current fragment

https://gerrit.wikimedia.org/r/1071826

Technical breadcrumb: MWDocumentReferences was accessing refs from the full document, so I've uploaded a patch limiting it to only see fragment refs for now.

Patch improves the situation but there are still problems. First of all, the image caption can be edited two different ways (directly clicking in the caption region, vs. opening the image dialog) and these already have divergent ref reuse behaviors. Second of all, these steps will lead to an "undefined" ref:

  • add an image
  • edit the caption and add a ref to it
  • re-use the ref in the caption
  • apply changes
  • Result is [undefined][1] in the VE preview and on save just two ref's with the same content are created.

on save just two ref's with the same content are created.

This seems to be the case since some time ( e.g. could reproduce that on v1.39.8 )

awight moved this task from Doing to Demo on the WMDE-TechWish-Sprint-2024-09-04 board.

Since what remains after the patch is a "known bug" that has existed for years, I don't plan to work further on the issue until we can do another round of prioritization.

Change #1071826 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Try to always limit our document references to the current fragment

https://gerrit.wikimedia.org/r/1071826

Since what remains after the patch is a "known bug" that has existed for years, I don't plan to work further on the issue until we can do another round of prioritization.

The bug is tracked under T374866: VE does not link ad-hoc re-uses of refs in an image caption now.

Tobi_WMDE_SW claimed this task.