Template:domxref is unable to resolve a cross-reference

RESOLVED FIXED

Status

Mozilla Developer Network
Editing
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: robwu, Unassigned)

Tracking

Details

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Build ID: 20120615233552

Steps to reproduce:

I used the domxref template to create a cross-reference.https://developer-new.mozilla.org/docs/new?slug=undefined/DOM/window.showModalDialog


Actual results:

Upon preview, the link is resolved to:
https://developer-new.mozilla.org/docs/new?slug=undefined/DOM/window.alert

After saving the edit, the URL becomes:
https://developer-new.mozilla.org/docs/new?slug=en-US/DOM/window.alert


Expected results:

In both cases, the expected result is:
https://developer-new.mozilla.org/en-US/docs/DOM/window.alert
I'm a little confused. To what DOM term were you trying to create the link? You don't mention that here.
(Reporter)

Comment 2

6 years ago
(In reply to Eric Shepherd [:sheppy] from comment #1)
> I'm a little confused. To what DOM term were you trying to create the link?
> You don't mention that here.

I'm referring to the domxref template, see https://developer-new.mozilla.org/en/docs/Template%3Adomxref.
Yeah, I understand you're using the domxref template, but what page are you trying to link to, and on which page are you using it? That's not clear from the way you worded the bug report. :)
(Reporter)

Comment 4

6 years ago
Sorry, I just noticed that the first link was incorrect. I should have linked to https://developer-new.mozilla.org/en-US/docs/DOM/window.onbeforeunload.

I followed the following steps to produce the problem:

1. Source mode (to manually add templates)
2. I typed `{{domxref("window.alert()")}}`
3. I previewed the edit to observe that the link's target is "/docs/new?slug=undefined/DOM/window.alert".
4. I saved the edit, and see that the link points to "/docs/new?slug=en-US/DOM/window.alert".

Because `/en-US/docs/DOM/window.alert` exists, I expected that the link points to that path.
That helped a ton! Turns out there were a couple of bugs in the domxref template. I've fixed those, and all seems well now!

Thanks for this report, I appreciate it!
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Updated

5 years ago
Version: Kuma → unspecified
(Assignee)

Updated

5 years ago
Component: Docs Platform → Editing
Product: Mozilla Developer Network → Mozilla Developer Network
You need to log in before you can comment on or make changes to this bug.