Page MenuHomePhabricator

this.model.getOuterRange is not a function
Closed, ResolvedPublic1 Estimated Story Points

Description

In file ve.ui.ContextItem.js this.model.getOuterRange() is being called but it doesn't exist as per file ve.dm.Model.js

Event Timeline

Nischayn22 raised the priority of this task from to Needs Triage.
Nischayn22 updated the task description. (Show Details)
Nischayn22 added a project: VisualEditor.
Nischayn22 subscribed.

How are you triggering this bug? this.model should be a ve.dm.Node which implements the method.

I have a VE plugin for SemanticMediaWiki extension that calls getFragment()
See https://en.wikipedia.org/wiki/User:Nischayn22/veSMW.js

Firstly instead of overriding core classes, you should be creating subclasses and registering those over the originals. I'm not sure what you need the fragment for at this point, but there are other places to get it depending on when you need it.

I understand that's more of a comment on the code rather than this bug. I code is very messy, I need to fix it but first I need to make it working.

Change 223817 had a related patch set uploaded (by Esanders):
Add checks to ve.ui.ContextItem#getFragment

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

Change 223817 merged by jenkins-bot:
Add checks to ve.ui.ContextItem#getFragment

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

Jdforrester-WMF assigned this task to Esanders.
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF set Security to None.