Here is the fix.

CTools already has logic to account for this, but dialog was not utilizing it.

There are two hunks in the patch that I'm not sure why they are there. Just whitespace I imagine.

Comments

drewish’s picture

It'd be better if you could re-roll this without the whitespace changes. Try using "cvs diff -upw".

drewish’s picture

Also, could you explain how I could generate the problem and make sure the patch resolves?

te-brian’s picture

I'll try to get a patch in the morning. To reproduce the problem:

1. Make sure css and js aggregation is on.
2. In one tab/browser load a page (make sure you are not user 1).
3. In a different tab clear all caches (I use admin_menu, basically cause the aggregate to be regenerated).
4. In the first tab, open a dialog.

If you watch the requests (in firebug or whatever) you will see it trying to overload all of the css/js on the site because the aggregate has changed. CTools contains logic that normally prevents this by keeping track of all individual css/js files on the page. The ajax include defines a constant that triggers this.

// Set this so we can tell that the file has been included at some point.
define('CTOOLS_AJAX_INCLUDED', 1);
drewish’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)
StatusFileSize
new724 bytes

Great, confirmed the problem and that the fix addresses it. I modified the comment a bit to help clarify its purpose.

Committed to 6.x kicking this over to 7.x for review.

te-brian’s picture

Thanks drewish, sorry again about the whitespace ... I have eclipse set to trim all extra whitespace. Keeps my code clean but gets me into trouble with patches.

jptaranto’s picture

I'm reporting this issue on 7.x-dev latest - when using JS aggregation, the jquery.xLazyLoader is loading in all JS files again.

The patch above (from around a year ago now) doesn't apply.

Cheers

wesnick’s picture

StatusFileSize
new1.15 KB

Here is a patch to resolve this issue on D7. Since we are not using ctools, we have to just use the technique found in function ajax_render

      // Ensure that the page doesn't reload what it already has.
      $items[$type] = array_diff_key($items[$type], $_POST['ajax_page_state'][$type]);
wesnick’s picture

Status: Patch (to be ported) » Needs review

That patch didn't link correctly, also setting to needs review

wesnick’s picture

Arrrg... and the patch

bendikrb’s picture

I can confirm that #9 works. Thank you!

mvc’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

works perfectly for me. i haven't even turned css or js aggregation on for my site, but color.css was being loaded without the color module's preprocessing meaning all my theme colours were being reset to their default values both in the dialog and in the rest of the page. this module should probably be doing that preprocessing, which would be another bug, but it definitely shouldn't be reloading css or js which are already present.

mvc’s picture

for the record, an open bug for the lack of preprocessing is here: #1994676: Dialog content rendered in inproper way

but again, that's a larger issue and this patch fixes the smaller, simpler problem.

devin carlson’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

The 7.x-1.x branch of the Dialog module is unsupported.