Some javascript conflict, i think Some javascript conflict, i think
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Some javascript conflict, i think

Started by federico.violante, February 05, 2011, 02:23:10 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

federico.violante

Hello, I use a Coppermine Gallery 1.5.12 (migrated from 1.4.24) bridged to Joomla 1.5.22 with +25k pictures
I ran older versions, 1.4.24 and Joomla 1.0.17 or so, without problema.
After upgrading both, I have a strange behavior

The most stringent issue is that I can't add a new album, giving me the error "Albums need to have a name".
I browsed through the code and i cant find the section that receives the form action.
 
Also, when I modify a config section and save, I miss immediately all the others, except when i explode and fill all options.

This seems to me a conflict between javascript libraries.
The "board" is at http://www.corrilabruzzo.it/copper
User test password test
Thank you in advance
Fred

federico.violante

Quote from: federico.violante on February 05, 2011, 02:23:10 PM
Hello, I use a Coppermine Gallery 1.5.12 (migrated from 1.4.24) bridged to Joomla 1.5.22 with +25k pictures
I ran older versions, 1.4.24 and Joomla 1.0.17 or so, without problema.
After upgrading both, I have a strange behavior

This seems to me a conflict between javascript libraries.
The "board" is at http://www.corrilabruzzo.it/copper
User test password test
Thank you in advance
Fred

I have unbridged the gallery and seems to work fine, or almost better.
At this point i am almost sure that is some conflicting javascript library, or maybe alternate version of jquery loaded by a plugin o component. Joomla uses seems to have mootools included by default. 

federico.violante

Quote from: federico.violante on February 05, 2011, 02:51:33 PM
I have unbridged the gallery and seems to work fine, or almost better.
At this point i am almost sure that is some conflicting javascript library, or maybe alternate version of jquery loaded by a plugin o component. Joomla uses seems to have mootools included by default. 


Seems more a problem with bridging. I have inspected the page source and seen that included javascript is almost the same. Also temporarily removed mootools. Same issue.
Tried disabling joomla->coppermine visual integration, no change.
At this point the remaining candidate is joomla15.inc.php.
I am trying to automatically disable the bridge, may be through session variables or url params, to leave browsing fully integrated and allow managing of albums. The only place where i can do it is in init.inc.php.
Should never touch core files, but there is a choice ?

federico.violante

Quote from: federico.violante on February 06, 2011, 09:03:01 AM
Seems more a problem with bridging.
....
Should never touch core files, but there is a choice ?

Partially solved with:

<when the user is a joomla admin, unbridge for him (must repeat logon also on coppermine)>

that fit my case and may be useful for others. I am sorry but, i have not found better ways, the problem should come from handling of POST variables coming from albmgr.js

changed three lines in init.inc.php

-- original code --

if ($CONFIG['bridge_enable'] == 1 && !defined('BRIDGEMGR_PHP')) {
    $BRIDGE = cpg_get_bridge_db_values();
} else {
    $BRIDGE['short_name']              = 'coppermine';
    $BRIDGE['recovery_logon_failures'] = 0;
    $BRIDGE['use_post_based_groups']   = false;
}

-- modified code --

user_get_profile();
$isadmin=($USER['am']>0);

if ($CONFIG['bridge_enable'] == 1 && !defined('BRIDGEMGR_PHP') && !($isadmin==1)) {
    $BRIDGE = cpg_get_bridge_db_values();
} else {
    $BRIDGE['short_name']              = 'coppermine';
    $BRIDGE['recovery_logon_failures'] = 0;
    $BRIDGE['use_post_based_groups']   = false;
}

Αndré

Phill also had some trouble with mootools: http://forum.coppermine-gallery.net/index.php/topic,70174.0.html

Unfortunately there's no solution in that thread yet.

federico.violante

Thank you for the suggestion, André

I am thinking that is not a problem with mootools (I also temporarily removed it, no change), but a conflict between ajax/jquery and the bridging logic. I don't know from which version was introduced jquery, (i jumped from 1.14.24 to 1.5.12). If not recently, should be strange if I am the first to hit the question.

Sadly I don't have a strong background in each of the parties involved jquery, coppermine core, themes and bridge, because until now they worked remarkably well, with the exception for me of batch adding (may be too many folders or pictures), that in the new version runs without a glitch.

At this moment I could survive with automatic unbridging, may be I could go back to cpg 1.4 if I need, but I think we should look ahead and solve problems when we found one on our way.
Also cpg 1.5 has new interesting functionalities well worth some head scraping.

I think this thread could be moved to the bridging section.
Fred

Αndré

jQuery has been introduced in an early development stage of cpg1.5.x, so it has been in all cpg1.5.x releases. Maybe Phill can confirm that your code change works for him, too.

phill104

I've seen this on quite a few installs. I have a lot of hacks involved in getting my own site to work but I hesitate to do this for others. To do things correctly we need to separate the different libraries using the jquery no-conflict mode but I am yet to find a way to do this properly. My interim fix is to cycle through all the coppermine jquery files and replace $ with jQuery. It works but is not pretty - http://www.windsurf.me.uk

In my case the above code would not work as the coppermine code conflicts with the menu system in place on the Joomla template. I've now seen over 20 sites where people have similar issues and a couple would help with the code you detail so thanks for that.
It is a mistake to think you can solve any major problems just with potatoes.