It seems that whenever I try to install an install profile that has jquery colorpicker required it throws an error. The only thing I could find is that jquery color picker is checking for the location of the colorpicker javascript based on $path. It populates path from
$path = drupal_get_path('module', 'jquery_colorpicker') . '/';

This appears to be a problem when running the .install file as part of an install profile because the path function to the module shouldn't be populated yet. This causes it to look for colorpicker in /colorpicker/ (directory root) instead of the current active folder or even the correct install location. I'm not sure how to resolve this or I'd submit a patch with this but wanted to document the issue and see if anyone else has experienced this.

Comments

plopesc’s picture

Hello.

You're right. After your message I started to look for that problem and I found fort example #1027600: call to drupal_get_path() in hook_requirements() fails during install profile or #325831: url() in hook_requirements breaks install profiles, where you can find the same problem.

However, I didn't take into account before. If you want to commit a patch, I would be very grateful. otherwise, I'll try to fix it as soon as possible.

Regards

btopro’s picture

I think on install you could do a look up for either profiles/... Whatever or sites/all/... Since it'll be relative paths. I'll look into it a bit further today and try to submit a patch.

btopro’s picture

super easy fix. Add this:

//account for install profiles
      if ($path == '/') {
        $path = dirname(__FILE__) . '/';
      }

right after line 101

elseif($phase == 'install')
	{
plopesc’s picture

Hello

Thanks for your effort!!
I'd like to ask you a question about your install profile...
If you try to put the colorpicker folder in the libraries folder instead of the module folder, it works fine?

I think that the best option could be remove that option and work only from the libraries folder.
Could you test it from your install profile?

You should force that the libraries module is installed before, please add the line

dependencies[] = libraries

to the jquery_colorpicker.info file

Thanks a lot!!

btopro’s picture

Are you saying try putting it there w.o. my patch or with the patch? I'll be building the install profile soon for a release so just let me know which way you'd like me to go with it.

lkujala’s picture

I think this issue is causing other modules to fail... in particular the Fusion Theme. when I try to configure the fusion theme the color settings block is missing and an error message is logged:
sites/all/modules/jquery_colorpicker/colorpicker/images/select.png page not found
OR
/sites/all/modules/jquery_colorpicker/colorpicker/js/colorpicker.js?j page not found


It sure looks like the error in the url is caused by this problem.

So, how do I try out the suggested patch? Other than editing the code, what else do I need to do to update the module?
Quickfix :: CREATE the colorpicker folder manually and MOVE the js folder into the colorpicker folder...
Correction:: COPY the js folder into the colorpicker folder... there are links to both paths.... :(

works until the next release :)

btopro’s picture

minor code change in #3 fixed this issue for me.

plopesc’s picture

Hello
I was really busy last weeks.
I'll try to release a new version that fixes this bug this week.

Regards

plopesc’s picture

Status: Active » Fixed

It should be fixed in last commit.

You can download the 6.x-2.3 release.
Thanks for your collaboration.

Regards

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.