Page MenuHomePhabricator

ContentTranslation's CXTargetLink.prototype.getSourceLink can create non-existent links
Closed, ResolvedPublic

Description

CXTargetLink.prototype.getSourceLink says:

		$sourceLink = $( '.cx-column--source .cx-link[data-linkid="' + this.getId() + '"]' );

		// It is not necessary that the link exists in the document.
		// We create CXSourceLink instances out of titles(Either searched or selected)
		if ( !$sourceLink.length ) {
			sourceLink = new CXSourceLink();
			sourceLink.setTitle( this.getTitle() );
			sourceLink.setId( this.getId() );
			return sourceLink;
		}

Why is it useful to create a source link that doesn't have any meaning?

I suspect that this is the thing that gets in the way of resolving T105915. If we didn't create objects for non-existent links, we'd know not to point at them.