Page MenuHomePhabricator

ZObjectSelector: throws a console error on the typeUrl function
Closed, ResolvedPublicBUG REPORT

Description

Console error when loading a type page

Steps to reproduce:

  1. Go to https://wikifunctions.beta.wmflabs.org/wiki/Z10005
  2. Open the console

Observed behavior:

  • There is a console error, "unable to parse title"

Expected behavior (Acceptance criteria):

  • There is no console error

Devices and Design (URLs or screenshots, if applicable):

  • Desktop: ...
  • Small screens/mobile: ...

Completion checklist

Event Timeline

The console error is displayed on any page (it was displayed on Boolean, Implementation, Natural language etc)

Error: Unable to parse title
    at new Title
at Proxy.typeUrl
at Proxy.render (eval at Fp ...)

The error logged at

"resources/src/vue/errorLogger.js": function(require, module, exports) {
            module.exports = {
                install: function(app) {
                    app.config.errorHandler = function(error) {
                        mw.errorLogger.logError(error, 'error.vue');
                        mw.log.error(error);

Change 854973 had a related patch set uploaded (by Teleosteen; author: Teleosteen):

[mediawiki/extensions/WikiLambda@master] Remove unused object selector

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

I proposed a patch, with much uncertainty.

I found what component callpoint was the culprit. But I could not figure out how it is meant to be used / displayed.

Looking at the code history, it seems it was used when in editing mode. But when editing an object we can easily add new localized labels.

Can you tell me whether I am right? Thanks in advance

On edit mode, the ZObjectSelector is used for choosing a new language to add to the array of labels. That's the only way to add multilingual labels for non-function objects (apart from raw updating the object through the API), so we should not remove this selector.

I did some exploration of this issue:

  • ZObjectSelector is necessary when editing mode, but should not be there on view mode
  • However, the ZObjectSelector doesn't have any conditional rendering clause, so when in view mode, the app tries to load the selector and it throws a console error.
  • just adding a v-if="!viewmode" condition to this ZObjectSelector fixes the issue

@Teleosteen thanks to you removing that component altogether led me to think that the issue was on the component rendering, so yay!!! thanks! Would you like to edit your patch and replace the component removal with this fix?

@gengh Good, I took into account your remark :)

Change 854973 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] ZLabelsBlock: do not render language selector in viewmode

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