2sic / 2sxc

DNN + 2sxc = #DNNCMS - This tool helps web designers and developers prepare great looking content in DNN (DotNetNuke). It's like mixing DNN with Umbraco and Drupal :)
http://2sxc.org
MIT License
145 stars 39 forks source link

Can't drag-move contents around in a page (DNN 08.00.04 bug) #963

Closed mangiove closed 7 years ago

mangiove commented 7 years ago

It seems that trying to moving with drag and drop a 2sxc Content module from a container to another in a page does not work. At page refresh it stays still in the old position. It does work fine moving a normal HTML module. Moving a 2sxc Content selecting the container id from the drop down menu works fine.

iJungleboy commented 7 years ago

I'm not aware of anything special where the 2sxc module could affect that. There is nothing related to module-moving that we would be handling. Could you please check what causes the error? Using Fiddler and F12 in the browser. Moving a module should usually cause DNN to call a web-api, and receiving an ok, reload the page. Please find out where it fails in your case.

mangiove commented 7 years ago

I tryed to see using F12 and moving a 2scx content, but nothing seems to go wrong. Moving a standard HTML content (that works) , looking with F12 tools it just seems to happen the same things. Any suggest?

Maybe knowing the method name I could try to debug it with Firefox :)

iJungleboy commented 7 years ago

I found a similar older issue#855 - that suggests, that if your template may not close a div or something, then this behaviour could happen. so that means your content-template may be the issue, as it is rendered into the dnn page.

Could you try this move-functionality with an empty 2sxc module?

mangiove commented 7 years ago

I tryed with the default dnn skin and with a 2sxc getting started module content, so it wasn't my skin or my 2sxc template. I could not found any html issue... Moving the module selecting the destination container name it works. Dragging it not working. Moving a standard module HTML works fine in both mode... Any other suggest please? Thanks

iJungleboy commented 7 years ago

@mangiove I simply cannot reproduce the issue - it must be something on your system. I tried moving both 2sxc-content as well as 2sxc-app modules with drag-drop on a dnn 7 and 8, and it all worked flawlessly. I believe there is something in your install - probably something very trivial but still troubling.

I'll close this issue, but will keep answering your questions. Here are some more recommendations to corner the issue:

  1. Try with another (default dnn) skin - see if that works
  2. try with another browser
  3. watch the data-traffic with fiddler, because if you watch it in the browser after the move-command it will reload the page, and you'll lose the trafic that was exchanged before.
mangiove commented 7 years ago

Hi, I just tryed some things.. Default dnn skin gravity Google chrome, cleared cache I tryed with fiddler to move a HTML module and a 2sxc one.

This is the 2sxc demo module (address content of getting started) Request URL: http://www.baffirandagi.it/DesktopModules/InternalServices/API/ModuleService/MoveModule Request Method: POST Status Code: 200 Form Data ModuleId: 2 ModuleOrder: 0 Pane: leftPane TabId: 84 Cookie .ASPXANONYMOUS: kvHWNiyijtgxFmNFksD689bOd5UeWhuiSyTa5gNxj-7ImFDGoov3jqU3JUWMHOkhgXFhKJqPqcIJPOGsn0k-m8jJxEoyEbcAiEFeMvcu-JcQodya0 DNNPersonalization: __RequestVerificationToken: L-MOf1oHYs7uDXC_V2vZmE3Cp-lGHQFD50Ed_vqdu8VGAmZd1zanf1hulK1VRZztMNq3wQ2 LastPageId: 0:84 __utmt: 1 __utma: 29853868.980538308.1475917075.1475917075.1475921171.2 __utmb: 29853868.1.10.1475921171 __utmc: 29853868 __utmz: 29853868.1475917075.1.1.utmcsr USERNAME_CHANGED: authentication: DNN .DOTNETNUKE: 6949B7D0CA5D529C78A92845FA4D8842CB9BE8DFA4D7220D3F82045845B12BADEF7AD1931FD4F7328B5A9E79DA2C788664548BA4683EC18FEC64D2D6E4A773D0C7BA02C58359E916BCE721F84915F501317391A7 dnn_IsMobile: False language: it-IT StayInEditMode: YES Request Headers (13) TabId: 84 RequestVerificationToken: VOFE031ciprTlIULCR_WVw2VwaOetD0B9GH0HCNjxWHTc13BFAMw0ooUvFROclr9hpeo0Pxdy23lhGWReNdfUYrlefM1 Origin: http://www.baffirandagi.it User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Accept: */* X-DevTools-Emulate-Network-Conditions-Client-Id: b0f182a9-28e2-41b7-bf50-f8e069f7f2a4 X-Requested-With: XMLHttpRequest ModuleId: undefined Referer: http://www.baffirandagi.it/test Accept-Encoding: gzip, deflate Accept-Language: it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4 Cookie: .ASPXANONYMOUS=kvHWNiyijtgxFmNFksD689bOd5UeWhuiSyTa5gNxj-7ImFDGoov3jqU3JUWMHOkhgXFhKJqPqcIJPOGsn0k-m8jJxEoyEbcAiEFeMvcu-JcQodya0; DNNPersonalization=EDIT; __RequestVerificationToken=L-MOf1oHYs7uDXC_V2vZmE3Cp-lGHQFD50Ed_vqdu8VGAmZd1zanf1hulK1VRZztMNq3wQ2; LastPageId=0:84; __utmt=1; __utma=29853868.980538308.1475917075.1475917075.1475921171.2; __utmb=29853868.1.10.1475921171; __utmc=29853868; __utmz=29853868.1475917075.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); USERNAME_CHANGED=; authentication=DNN; .DOTNETNUKE=6949B7D0CA5D529C78A92845FA4D8842CB9BE8DFA4D7220D3F82045845B12BADEF7AD1931FD4F7328B5A9E79DA2C788664548BA4683EC18FEC64D2D6E4A773D0C7BA02C58359E916BCE721F84915F501317391A7; dnn_IsMobile=False; language=it-IT; StayInEditMode=YES Response Headers (8) Cache-Control: no-cache Pragma: no-cache Expires: -1 Set-Cookie: dnn_IsMobile=False; path=/; HttpOnly Set-Cookie: dnn_IsMobile=False; path=/; HttpOnly Set-Cookie: language=it-IT; path=/; HttpOnly Date: Sat, 08 Oct 2016 10:06:28 GMT Content-Length: 0

This is HTML module Request URL: http://www.baffirandagi.it/DesktopModules/InternalServices/API/ModuleService/MoveModule Request Method: POST Status Code: 200 Form Data ModuleId: 481 ModuleOrder: 0 Pane: footerLeftPane TabId: 84 Cookie .ASPXANONYMOUS: kvHWNiyijtgxFmNFksD689bOd5UeWhuiSyTa5gNxj-7ImFDGoov3jqU3JUWMHOkhgXFhKJqPqcIJPOGsn0k-m8jJxEoyEbcAiEFeMvcu-JcQodya0 DNNPersonalization: __RequestVerificationToken: L-MOf1oHYs7uDXC_V2vZmE3Cp-lGHQFD50Ed_vqdu8VGAmZd1zanf1hulK1VRZztMNq3wQ2 LastPageId: 0:84 __utmt: 1 __utma: 29853868.980538308.1475917075.1475917075.1475921171.2 __utmb: 29853868.1.10.1475921171 __utmc: 29853868 __utmz: 29853868.1475917075.1.1.utmcsr USERNAME_CHANGED: authentication: DNN .DOTNETNUKE: 6949B7D0CA5D529C78A92845FA4D8842CB9BE8DFA4D7220D3F82045845B12BADEF7AD1931FD4F7328B5A9E79DA2C788664548BA4683EC18FEC64D2D6E4A773D0C7BA02C58359E916BCE721F84915F501317391A7 dnn_IsMobile: False language: it-IT StayInEditMode: YES Request Headers (13) TabId: 84 RequestVerificationToken: R7fhYNS67_bSMd_KUZeC3mF1yoKHt7Vw1EDZlfiVswqnSGOIFGF1-13h_L0uEYUw1JcTOu8mkHN28IBBoHVQXPqsdZo1 Origin: http://www.baffirandagi.it User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Accept: */* X-DevTools-Emulate-Network-Conditions-Client-Id: b0f182a9-28e2-41b7-bf50-f8e069f7f2a4 X-Requested-With: XMLHttpRequest ModuleId: undefined Referer: http://www.baffirandagi.it/test Accept-Encoding: gzip, deflate Accept-Language: it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4 Cookie: .ASPXANONYMOUS=kvHWNiyijtgxFmNFksD689bOd5UeWhuiSyTa5gNxj-7ImFDGoov3jqU3JUWMHOkhgXFhKJqPqcIJPOGsn0k-m8jJxEoyEbcAiEFeMvcu-JcQodya0; DNNPersonalization=EDIT; __RequestVerificationToken=L-MOf1oHYs7uDXC_V2vZmE3Cp-lGHQFD50Ed_vqdu8VGAmZd1zanf1hulK1VRZztMNq3wQ2; LastPageId=0:84; __utmt=1; __utma=29853868.980538308.1475917075.1475917075.1475921171.2; __utmb=29853868.1.10.1475921171; __utmc=29853868; __utmz=29853868.1475917075.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); USERNAME_CHANGED=; authentication=DNN; .DOTNETNUKE=6949B7D0CA5D529C78A92845FA4D8842CB9BE8DFA4D7220D3F82045845B12BADEF7AD1931FD4F7328B5A9E79DA2C788664548BA4683EC18FEC64D2D6E4A773D0C7BA02C58359E916BCE721F84915F501317391A7; dnn_IsMobile=False; language=it-IT; StayInEditMode=YES Response Headers (8) Cache-Control: no-cache Pragma: no-cache Expires: -1 Set-Cookie: dnn_IsMobile=False; path=/; HttpOnly Set-Cookie: dnn_IsMobile=False; path=/; HttpOnly Set-Cookie: language=it-IT; path=/; HttpOnly Date: Sat, 08 Oct 2016 10:08:35 GMT Content-Length: 0

After refreh HTML module stay in the new position, 2sxc one return to the old one. This only happens with drag and drop. Selecting a new position from the menu context it does work on both

In the fiddler responses I can't see anything wrong... Any other suggestion please? :)

mangiove commented 7 years ago

Just a little update to this, I just set up a new dnn installation, with nothing else that latest 2sxc version. Added in a page with default skin a demo 2sxc gallery app, and a demo 2sxc address content. Can't move them around. Here is a screencast of the issue drag_drop_move_issue.zip

iJungleboy commented 7 years ago

Thanks. This is very strange, will re-open

iJungleboy commented 7 years ago

I tried again - even with the default skin and with gallery on the same page, it all works: http://screencast.com/t/McjT20bxV

Any more ideas why? It seems very specific to your installation.

mangiove commented 7 years ago

Hello I just sent you access data of my environment test site @ info@2sxc.org so you can have a look at the issue! Thanks :)

iJungleboy commented 7 years ago

@mangiove I found the cause. It's a new DNN bug which only seems to exist in DNN 08.00.04, DNN 08.00.03 didn't have it. Here's the problem: when drag-dropping an item on screen, the dnn script tries to find the module-ID which was just used, to then tell the server that module 406 or whatever has moved.

To find the module-id, it uses a regular expression in 08.00.04 which is unreliable, namely file: /resources/shared/scripts/dnn.dragDrop.js

        var getModuleId = function ($mod) {
            var result = $mod.attr("class").match(/DnnModule-([0-9]+)/);
            return (result && result.length === 2) ? result[1] : null;
        };

In previous versions it was

        var getModuleId = function ($mod) {
            return $mod.find("a").first().attr("name");
        };

because of this change, any module which begins with a number (like 2sxc or 2sxc-app) is mistakenly detected as being module 2, so it tells the server to move module 2, instead of 406, to the new location. The server ignores this, and reloads the page.

I've opened a JIRA ticket https://dnntracker.atlassian.net/browse/DNN-8944

and will close this for now. If we see that many are affected, we'll try to provide a workaround.

mangiove commented 7 years ago

Nice one! Thanks you 👍

iJungleboy commented 7 years ago

fyi: I created a script which patches DNN and I added it to the page - works like a charm. You can use it for now, or I'll try to include it in 2sxc 8.6 in 2-3 weeks.

It's documented on #986

mangiove commented 7 years ago

Nice one. In the mean time I will modify the js script of my dnn installation. Hope that dnn community will fix out this soon so you don't have to worries about provide it in a 2sxc installation. Thanks you!

----Messaggio originale----

Da: notifications@github.com

Data: 20-ott-2016 11.33

A: "2sic/2sxc"2sxc@noreply.github.com

Cc: "mangiove"mangiove@tin.it, "Mention"mention@noreply.github.com

Ogg: Re: [2sic/2sxc] Can't drag-move contents around in a page (DNN 08.00.04 bug) (#963)

fyi: I created a script which patches DNN and I added it to the page - works like a charm. You can use it for now, or I'll try to include it in 2sxc 8.6 in 2-3 weeks.

It's documented on #986

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/2sic/2sxc","title":"2sic/2sxc","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/2sic/2sxc"}},"updates":{"snippets":[{"icon":"PERSON","message":"@iJungleboy in #963: fyi: I created a script which patches DNN and I added it to the page - works like a charm. You can use it for now, or I'll try to include it in 2sxc 8.6 in 2-3 weeks. \r\n\r\nIt's documented on #986 "}],"action":{"name":"View Issue","url":"https://github.com/2sic/2sxc/issues/963#issuecomment-255057135"}}}