Why?

I have a use case where I alter the relation select form by adding an "Add" button which makes an separate AJAX call to a handler creating an entity for me.

Now, my next step is to extend with couple extra functions working together with functions inside Drupal.behaviors.relationSelect but the problem is that some of the functions are using relationSelectItems variable and it's not accessible outside the behavior function.

Proposed solution

Make relationSelectItems global by creating an property for Drupal object as follows:

Drupal.relationSelect = {
    items: {}
  }

Then just rename the variables from relationSelectItems to Drupal.relationSelect.items.

CommentFileSizeAuthor
#1 1432714-1.patch2.93 KBimiksu

Comments

imiksu’s picture

Status: Active » Needs review
StatusFileSize
new2.93 KB

Here is a patch file of the proposed solution.

imiksu’s picture

Status: Needs review » Closed (won't fix)

After a while of struggling around with my use case, I found out that there is plenty of other things to do before getting my use case to work.

This feature request goes irrelevant in that case..