Advanced search  

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

Pages: [1] 2 3   Go Down

Author Topic: Drupal 6 bridge  (Read 102288 times)

0 Members and 1 Guest are viewing this topic.

extrabigmehdi

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 65
Drupal 6 bridge
« on: March 26, 2009, 05:43:06 am »

hi ,
I wanted to release a bridge with an other CMS. I thought that having a second example would help to fine tune ,and improve support for my bridge logic (i.e not caring of sessions or cookies, including target app..). This seems to work "almost" fine with Drupal 6.

There are very few difference in the plugin for visual integration , for joomla & drupal. But I  still prefer to have two versions for the moment.

Almost same installation as before, I let you find what are the difference in the setup here:
http://www.mehdiplugins.com/misc/cpgdrup.htm

Technical limitations I  found in drupal bridge:

* unlike joomla bridge, I  don't redestroy superglobals after including drupal. Because the cpg_udb object use some of the drupal methods, and killing superglobals can lead to errors. I'm tempted to do same on  the joomla bridge, even if I  don't get errors. Anyway, the Inspekt api just act as a filter that check validity of data. If the Inspekt api  is systematically used in coppermine code , I  don't see how restoring superglobals would be a security risk. Also in fact I only restore $_ENV, $_COOKIE, $_SERVER... Other superglobal are "constructed".

* couldn't appropriately implement get_user function. This  a pain to implement because now each user can belong to multiple groups, and there's no  "group id" column  in the user table etc... Basically this only affect the "users" button , with cpg administration. Normally if you click on users button, the bridge redirect you to management of users in drupal's backend.
Unfortunately this doesn't work, as soon as you enable visual integration, perhaps there's a conflict somewhere, I  don't know ...

* can't assign a particular  menu  item in query string. This means that it there's a menu link in drupal that point to the gallery,  this one won't be highlighted when user click on it , and you won't get "the right navigation path" that leads to gallery at top.

* warnings ... obviously coppermine disable warning errors. And drupal re-enable them. Which means you might see some warning errors  induced by coppermine.
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Drupal 6 bridge
« Reply #1 on: March 27, 2009, 07:41:54 pm »

Blimey, you are a busy bunny.

Well done ;D.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

NinjaNed

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Drupal 6 bridge
« Reply #2 on: March 21, 2010, 05:40:14 pm »

I tried to install and ran into this error : "This version is incompatible with the 6.16 version of Drupal core."  Can you recommend a workaround?

Thanks.
Logged

osimax

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Drupal 6 bridge
« Reply #3 on: July 04, 2010, 09:32:05 pm »

Hi!
I have installed your plugin and also visual integration.
All loooks nice. I am still working on css to make all looks consistent.

But I have encounered following error:
when I am browsing my drupal site as registered user and visit page with integrated coppermine gallery and after that I click any link on my site (not coppermine, but drupal link) - I get following message
Code: [Select]

    * warning: Missing argument 2 for CPGPluginAPI::filter(), called in /home/chesterr/data/www/osimax.com/cpg1/include/themes.inc.php on line 2909 and defined in /home/chesterr/data/www/osimax.com/cpg1/include/plugin_api.inc.php on line 158.
    * warning: Missing argument 2 for CPGPluginAPI::filter(), called in /home/chesterr/data/www/osimax.com/cpg1/include/themes.inc.php on line 3000 and defined in /home/chesterr/data/www/osimax.com/cpg1/include/plugin_api.inc.php on line 158.


When I browse site as anonymous user all is ok and no warnings displayed.
Thank you for your great plugin - it's what I wanted for long and hope for your advice regarding this warnings.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Drupal 6 bridge
« Reply #4 on: July 05, 2010, 09:11:51 am »

I get following message
Code: [Select]

    * warning: Missing argument 2 for CPGPluginAPI::filter(), called in /home/chesterr/data/www/osimax.com/cpg1/include/themes.inc.php on line 2909 and defined in /home/chesterr/data/www/osimax.com/cpg1/include/plugin_api.inc.php on line 158.
    * warning: Missing argument 2 for CPGPluginAPI::filter(), called in /home/chesterr/data/www/osimax.com/cpg1/include/themes.inc.php on line 3000 and defined in /home/chesterr/data/www/osimax.com/cpg1/include/plugin_api.inc.php on line 158.

Should be fixed in r7737.
Logged

palle

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Drupal 6 bridge
« Reply #5 on: July 09, 2010, 05:45:50 pm »

Thanks for the Bridge, Mehdi.

After install I have a rather big problem though - here is what I did:

1) Installed drupal 6.17
2) Installed Coppermine 1.5.6
3) Followed the instructions on http://www.mehdiplugins.com/misc/cpgdrup.htm

Result is that cpg is now visually integrated into drupal, BUT every I press on a menu item in either drupal or cpg, a white lightbox appears containing an image of a camera with a line over, see the attached image.

This only happens when I have entered the coppermine gallery, so to clarify further I can now do the following:

- Open my drupal page. This is good.
- Open a sub page, e.g. a blog. This is good.
- Open the coppermine gallery by typing the address in the browser address field - the coppermine gallery is now shown inside drupal. This is good
- But now I can no longer open a sub page, e.g. a blog, nor can I execute any cpg menu items without the image of the camera with a line across comes up.

A final note: I have not yet added any categories, albums or pictures to the coppermine gallery after install - can that be the problem?

Does anyone now what is wrong?
Logged

onthepike

  • Guest
Re: Drupal 6 bridge
« Reply #6 on: July 09, 2010, 05:57:29 pm »

I have not yet added any categories, albums or pictures to the coppermine gallery after install - can that be the problem?

You might want to do just that and begin adding files to your gallery. How else can you fully test it? In my opinion, this should have been attempted before a support request. Just stands to reason -- if you're able to add categories, albums and pictures, do so.

I don't have Drupal, so I cannot assist with any particulars. But generally speaking, Coppermine is a photo gallery. No photos? Well, not much of a gallery!

Additionally, any and all support requests require a link back to your Coppermine gallery, as per board rules.
Logged

extrabigmehdi

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 65
Re: Drupal 6 bridge
« Reply #7 on: July 12, 2010, 06:23:20 am »

hi,
recently tested the bridge for Drupal 6.
Works fine, except some warnings (from Coppermine) you might see (from times to times) when enabling visual integration.
The problem can be bypassed, by disabling the display of errors in drupal backend.

Also I've applied a fix, so that flash upload works. (similar, than other fix for joomla bridge).

cheers
Logged

palle

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Drupal 6 bridge
« Reply #8 on: July 12, 2010, 08:25:03 pm »

Reply to onthepike: I did not post my website as a reference, because I did not have any (I just installed and tested it locally) - that is why I attached a snapshot of the error. And no - the problem was not related to the absence of content (albums, images).

Here are my observations:

I found that the problems with the popping-up ligthbox camera image (see my previous posting) is caused by Drupals "ImageAPI" module. I had created some test content using ImageAPI, ImageCache, ImageCacheUI, Node Gallery, Note Gallery Access and Node Gallery Lightbox 2 Integration. When I had the "camera with a line across" error, I gradually removed all of those modules, but it was not until I removed the ImageAPI module that the error disappeared. I think the error is related rather than to the content I created rather than to the ImageAPI module being enabled, because I can not reproduce the error on a fresh installation of both drupal and cpg ny enabling only the ImageAPI module. I will not follow this any further - this is just to note my observations here should anyone else need them.

Regarding the use of the bridge itself, I have made some progress, but still have problems though.

Without the visualisation-plugin, everything works OK. I can log in to either of the two systems and then go to the other system and then already be logged in with the same credentials/rights. I can view pictures and do everything (at least all of the stuff I have tried) in coppermine.

But when I enable the visualization plugin, I have some problems:

1) I can see all the thumbnails on the cpg front page, but when I click on one of them, I get the following error: "Error You are not allowed to view any images".

2) I sometimes get these warnings:
warning: Missing argument 3 for cpg_die(), called in /home/www/egebjergvej.dk/billeder/displayimage.php on line 38 and defined in /home/www/egebjergvej.dk/billeder/include/functions.inc.php on line 353.
warning: Missing argument 4 for cpg_die(), called in /home/www/egebjergvej.dk/billeder/displayimage.php on line 38 and defined in /home/www/egebjergvej.dk/billeder/include/functions.inc.php on line 353.
These warnings are not a big deal, since (as mehdi wrote in the previous post) they can be configured not to be shown in drupal.

3) When I click on "Admin Tools" from the file menu, then I get the following error: "Critical error There was an error while processing a database query"

4) When I try to click on users (usermgr.php), then there is a blank page only showing the text "Fatal error :".

So suggestions to what could be wrong are very welcome :-)

I have deployed the system on the web now.
Drupal: http://www.egebjergvej.dk/
Drupal version is 6.17
Coppermine: http://www.egebjergvej.dk/billeder/
Coppermine version is 1.5.7(snapshot of svn version 7757 (last night))
User: test/test.

I think there is a huge need for this bridge - I have been searching some time for good drupal image gallery that facilitates a lot of nice stuff like Coppermine, i.e. easy batch upload/creation of albums, but I have only encountered a lot of postings on drupal.org where other guys look for the same as me. And it would just be excellent if cpg could just be used inside drupal instead!
Logged

palle

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Drupal 6 bridge
« Reply #9 on: July 13, 2010, 05:11:43 pm »

I have enabled debug mode, and that gives the following information (relating to the points in my previous post from 07.25 pm July the 12th 2010):

3)

In addition to the "Critical error...", the following info is given

Code: [Select]
While executing query 'SELECT uid AS user_id, name AS user_name FROM `<DATABASE_NAME>`.users ORDER BY name' in include/functions.inc.php on line 5957

mySQL error: Table '<DATABASE_NAME>.users' doesn't exist

(I substituted my real database name for <DATABASE_NAME>).

4)
In addition to "fatal error: ", the following info is given:

Code: [Select]
While executing query 'SELECT user_id FROM cpg15x_users WHERE user_name = '' AND user_id != load' in usermgr.php on line 1005

mySQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'load' at line 1

I hope that will give you a hint to what could be wrong...
Logged

palle

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Drupal 6 bridge
« Reply #10 on: July 13, 2010, 07:40:35 pm »

Because of the debug information given in my posting from 04:11 pm July 13th 2010, I just deployed the same system to a new site with a small change in order to do some more black box test on the problems.

Still drupal 6.17, cpg 1.5.7 (svn rev 7757).
New site:
http://www.egebjergvej.dk/bridgetest/ (drupal)
http://www.egebjergvej.dk/bridgetest/gallery/ (cpg)

This time I chose to not specify any database table prefix for cpg. And that actually took care of the fatal error 4) mentioned in my previous postings: Instead of the fatal error, I am now redirected to the user management in drupal - this is good.

So it could seem that something (error in my setup, error in drupal, error in cpg, error in the bridge) has the effect that the bridge makes cpg not consider table prefix correctly.

Error 3 is also gone - however now it indicates another error when choosing the admin tools:

Code: [Select]
While executing query 'SELECT uid AS user_id, name AS user_name FROM `pallepalle_db_bridge_test`.users ORDER BY name' in include/functions.inc.php on line 5957

mySQL error: Unknown column 'uid' in 'field list'

And errors 1 and 2 still remain the same. Still not good.

And one last thing: When disabling the visual integration plugin, error 1) still occurs. I just tried the same thing for my site created in my posting yesterday - and it had the same effect - error 1) is still present until I also disable the bridge. Strange, because yesterday I made the observation that error 1) was not present until I enabled the visual integration plugin....
Logged

extrabigmehdi

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 65
Re: Drupal 6 bridge
« Reply #11 on: July 14, 2010, 03:10:12 am »

@palle
just made some change to the bridge (overwrite the file drupal6.inc.php,  with the new one) . The issue with usermgr should be gone.

I don't know why you get an error with admin tools, it works fine for me.
According to your error, the drupal database is called pallepalle_db_bridge_test.
Inside this database , there's a table called users. But for a weird reason, the column uid is missing in this table (a mandatory column).
Maybe drupal is not properrly installed ? i  don't see why you get the error.
Is the column uid really  missing ? I'm not sure drupale could work without it.
Logged

palle

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Drupal 6 bridge
« Reply #12 on: July 14, 2010, 11:50:53 am »

@extrabigmehdi
Thanks for the usermgr fix.

And I also think we are closing in on the other errors now - I think the cause for error 1) and 3) must be the same...

According to your error, the drupal database is called pallepalle_db_bridge_test.
Inside this database , there's a table called users. But for a weird reason, the column uid is missing in this table (a mandatory column).
Maybe drupal is not properrly installed ? i  don't see why you get the error.
Is the column uid really  missing ? I'm not sure drupale could work without it.

Drupal is properly installed and also works fine regarding user management - the problem is that the database table pallepalle_db_bridge_test.users is not belonging to drupal, but to coppermine - as I wrote yesterday, coppermine was installed without database prefix. In coppermine, the id field is called user_id, not uid.

I am baffled that this works for you, as I should think it is a pretty basic error and that I can not see how you could get around it by having drupal and cpg share the same users table, as the layout is different.

The only thing I can come up with is my bridge settings that could be wrong - my settings are:

full_forum_url : http://www.egebjergvej.dk/bridgetest
relative_path_to_config_file : ../
use_post_based_groups : 1.

By the way, there is a small error in the online help when setting the URL of the bridge app - it says to contradictory things:
Code: [Select]
Make sure to add a trailing slash - the URL must be http://www.yourdomain.tld/forum/  and not just http://www.yourdomain.tld/forum

And when I do that, then I am given the following error:

There mustn't be a trailing slash in the field URL of the bridge app.

Again to recap, I did the following:
- Installed drupal (6.17)
- Installed coppermine (1.5.7 - 7757)
(- Same administrator with same password was used for both drupal and coppermine)
- Enabled cpg module in drupal
- Enabled drupal bridge in coppermine
- Enabled visual integration

I think the problems occur already after enabling the bridge, because after removing the visual integration, then the problem is present - but I will test that in a new install if this information does not help...
Logged

extrabigmehdi

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 65
Re: Drupal 6 bridge
« Reply #13 on: July 14, 2010, 04:37:44 pm »

hi,
since  both drupal & coppermine have a table called users,
you must ensure that either:
- you use a database prefix for coppermine
- install them in separate database.

Quote
the problem is that the database table pallepalle_db_bridge_test.users is not belonging to drupal, but to coppermine
Maybe you have installed coppermine after drupal, in same database ?

Quote
am baffled that this works for you,
I'm not dreaming, see screenshot:
EDIT: see post from moderator below.

Works also, when disabling visual integration. Clean url  of drupal doesn't seem to matter.

I've done a local install with last  version of wampserver. I've disabled the display of errors, and off course enabled gd2.

Your error  3 is not useful  because when I go to line 5957, I see no sql query.
Please don't use svn, but the regular coppermine release.
Quote
By the way, there is a small error in the online help when setting the URL of the bridge app
I think you can specify in the bridge code, either you want a trailing slash or not . I asked for not.
Not a big matter.

Quote
I think the cause for error 1) and 3) must be the same...
I also got error 1, but it's magically gone after a few random clicks. Maybe a bug from copermine ?

Ensure you run at least once the drupal cron.
And give at least permission "access cpg" to "authenticated users" in drupal backend for coppermine module , even if you get it by default for main admin drupal account.

The bridge code doesn't do any sql query. It just use either native functions of cpg or drupale (that might indirectly do  sql query).
The only sql thing I do, is when creating a database connection .
In fact it depends if the database connection to drupale is sql, or sqli.
If it's sql, I tell coppermine to re-use the existing connection.
Otherwise I tell coppermine to create a new sql connection, but I'm not even  sure that this one is used at all.
« Last Edit: July 14, 2010, 05:24:28 pm by extrabigmehdi »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Drupal 6 bridge
« Reply #14 on: July 14, 2010, 05:15:34 pm »

I'm not dreaming, see screenshot:
(http://i286.photobucket.com/albums/ll99/extrabigmehdi/th_drupa-capture.jpg)
Hotlinking is not allowed per board rules. Embedding images into postings has been disabled because of frequent abuse. That's why the board rules say that you should attach images instead of doing anything else. I did just that: I attached the image you refered to above to this posting.
Logged

extrabigmehdi

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 65
Re: Drupal 6 bridge
« Reply #15 on: July 14, 2010, 05:28:49 pm »

Sorry, If I didn't respect the rule of the board.
You can remove the link from the quote as well now .
Logged

palle

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Drupal 6 bridge
« Reply #16 on: July 15, 2010, 01:18:44 am »

@extrabigmehdi
Again, thanks for the answers.

But, this just will not work...

I have tried local install, web install at my ISP, and I just downloaded another Wamp than the one I used the other day - the result is the same - not working...

First to answer your questions:

Maybe you have installed coppermine after drupal, in same database ?
No, I have not installed the two systems in the same database without using two different table prefixes. As I wrote earlier, I tried to install coppermine without table prefix, but that was only to test if it would get rid of error 4) - which it did.

I'm not dreaming, see screenshot:
I did not mean that I did not believe you, just that I could not understand why I can't get it to work when you can...

I also got error 1, but it's magically gone after a few random clicks. Maybe a bug from copermine ?
Now, that is interesting - I thought only I had error 1). However, no matter how many random clicks I do, the error will not go away magically. Can you tell me which random clicks you do?

I have done a new install with the settings you have suggested, but as I wrote, the error is still present. Here is what I have done:

Code: [Select]
- Installed drupal version 6.17 (clean URL enabled)
database: pallepalle_db_bridge_test (table prefix is "drupal_")
Site: http://egebjergvej.dk/bridgetest2/

-  Installed coppermine version 1.5.6 (chose GD2)
database: pallepalle_coppermine  (table prefix is "cpg15x_")
Site: http://egebjergvej.dk/bridgetest2/gallery/

Both sites created with same adminstrator name/passwd
A user with credentials test/test added in drupal.

Then I created an album and added some pictures in coppermine

Then I checked that both drupal and coppermine works without problems.

Then added the bridging:
- installed and enabled cpg module in drupal (configured access for both registered and anonymous users). I run drupal cron with success.
- enabled the drupal bridge in coppermine, settings:
    full_forum_url : http://egebjergvej.dk/bridgetest2
    relative_path_to_config_file : ../
    use_post_based_groups : 1.
- installed the visual integration
I have attached two pictures of the errors I get (1 and 3).

The picture of error 1 shows the error message I get when I click on a picture. Does anyone know of a way to debug why I am not allowed - note that extramehdi has the same error, but he is able to make it disappear by performing som random clicks...

The picture of error 3 shows the error message I get when I click on "Admin tools", and I still think that it must have some sort of connection to error 1, and it could look like a database configuration problem in the bridge or coppermine - note that the coppermine error message says that it tried to find the uid field in the table pallepalle_db_bridge_test.users, but there is two problems with that: First, the uid field only exists in coppermine (not in drupal), so why does it look in the wrong database - coppermine database is "pallepalle_coppermine. And second, the table prefix seemed to disappear.

It does not matter for the errors whether visual integration is enabled or not.

@extrabigmehdi:
Which versions of drupal and coppermine do you use?
Which Wamp do you use?

Have anyone else sucessfully done this integration?



Logged

extrabigmehdi

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 65
Re: Drupal 6 bridge
« Reply #17 on: July 15, 2010, 02:22:59 am »

hi,
Quote
Now, that is interesting - I thought only I had error 1). However, no matter how many random clicks I do, the error will not go away magically. Can you tell me which random clicks you do?

Just re-installed both coppermine & drupal to get again the same error.
It seems that the error get fixed after clicking user/groups.
No change to settings there. Weird.

It's advised to  upload picture only after bridging, to ensure picture are assigned to right users.

Quote
Which versions of drupal and coppermine do you use?
Which Wamp do you use?
Latest version of each.

Logged

extrabigmehdi

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 65
Re: Drupal 6 bridge
« Reply #18 on: July 15, 2010, 03:40:12 am »

hi,
updated the bridge again : overwrite file drupal6.inc.php with new one.
What's fixed: drupal might use database prefix, but due to an error the bridge was ignoring it.

Note: you might need to create a role, assign "administer cpg" permission to this role, and finally assign this role to users you want.
Off course, you wouldn't want to assign permission "administer cpg"  directly to authenticated users.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Drupal 6 bridge
« Reply #19 on: July 15, 2010, 07:20:26 am »

Latest version of each.
That's a nonsensical approach: you as a developer should be aware of the fact that there's a reason why applications have version numbers: the word "latest" doesn't mean much, and it means even less for those who will come across this thread in a year or two. As far as Coppermine is concerned, you should use a subversion checkout for developing. In that case, use the revision number or the date you checked out. Version number of the files in the subversion repository would be cpg1.5.7...
Logged
Pages: [1] 2 3   Go Up
 

Page created in 0.038 seconds with 22 queries.