U4-8939 - Old openContentPicker() method is failing

Created by Rune Grønkjær 05 Sep 2016, 07:59:30 Updated by Rune Grønkjær 06 Sep 2016, 06:58:18

Tags: Unscheduled

Relates to: U4-8816

After upgrading to Umbraco 7.5 the openContentPicker() method is now throwing errors and the dialog is no longer working.

Normally the content pricker would open in the right hand dialog showing the root content node.

The problem is that jquery have been updated but the jquery.tree plugins was not updated as well. They are using the $.browser and .live() which has been removed from jquery for some time.

The jquery tree plugins probably needs to be updated.

/Rune

Comments

Sebastiaan Janssen 05 Sep 2016, 08:28:38

Can you give me a few steps on how to get to the openContentPicker() method? I have tried to update all of the jQuery tree stuff but there might still be something hiding somewhere that I couldn't find.

If it's in your own implementation, you can add jquery-migrate v1.4 which we now use in the core to make sure that $.browser and .live() work again.


Rune Grønkjær 05 Sep 2016, 08:42:51

I can see that my description is a little of. What we do is this:

function openContentPicker(fn) { parent.UmbClientMgr.openModalWindow('<%: TreeUrlGenerator.GetPickerUrl( "content", "content" ) %>', 'Choose Content', true, 300, 400, 60, null, null, function (args) { if (fn && args && args.outVal) { findContentName(args.outVal, function (name, breadcrump) { fn(args.outVal, name, breadcrump); }); } }); }

Our code calls the UmbClientMgr.openModalWindow which runs the jquery.tree stuff. "parent" is because we're in an iframe and the Umbraco javascript is loaded in the parent window.


Sebastiaan Janssen 05 Sep 2016, 09:19:40

So I'll see the problem when I install TeaCommerce? And what do I click to see it?


Rune Grønkjær 05 Sep 2016, 11:12:11

  1. Create new store (Note there's a bug that logs you out first time a store and campaign is created. Just hit F5 from the login screen)
  2. Create new marketing campaign
  3. Creatae new "product rule" on campaign
  4. Click "Edit" then "Choose..." and the errors will start in the console. The call to the Umbraco API is startet in the EditCampaign.aspx file line 19


Sebastiaan Janssen 05 Sep 2016, 12:26:49

Got it, thanks! Fixing now.


Sebastiaan Janssen 05 Sep 2016, 12:28:58

PR: https://github.com/umbraco/Umbraco-CMS/pull/1463


Rune Grønkjær 05 Sep 2016, 12:41:20

Fantastic. You are my HERO :)


Sebastiaan Janssen 05 Sep 2016, 15:01:26

@Rune.Grønkjær Lucky you, this made it into the release just now : https://our.umbraco.org/contribute/releases/753/


Rune Grønkjær 06 Sep 2016, 06:58:18

Just updated my solution to 7.5.3 and it now works (So that's fantastic) with one little quirk. First time i fold out the tree an "ncaught TypeError: $.curCSS is not a function" error is thrown. The second time it works: http://screencast.com/t/xbqMHs79

Thanks a lot for fixing it though! It will now work. It can't be perfect as long as we use legacy stuff.


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category: UI

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.5.1, 7.5.2

Due in version: 7.5.3

Sprint: Sprint 41

Story Points:

Cycle: