Feels a little hard to ask, but might you release this for Drupal 6?

Would love to use jQuery themes *properly*

Comments

chaby’s picture

At the moment, i haven't downgrade it in D6. But i can do it as soon as i have time

doublejosh’s picture

Thank, just wondering. If I have time on my project I might do it as well :)

puravida’s picture

+1
I would also really appreciate this. Been spending hours updating & installing jquery only to get stuck with eggplant and hot_sneaks uploaded but can't figure out how to switch to that theme or get working in new content. Hopefully I will figure this out today but would still like to have this for our D6 implementation, since it will be quite awhile before enough modules are supported to allow an upgrade to D7.

chaby’s picture

I have create a 6.x branch available here. Only few things have not been done like :

  • No support for tar format and other compress format like gz/bz2: only zip supported
  • At the moment, only jQuery UI themes 1.7 are supported (In fact, i have not tested jquery ui library greater than 1.7 with jQuery UI and jQuery Update modules...)

It needs some reviews, could you do it please ?

chaby’s picture

A release have been done

doublejosh’s picture

Awesome, thank you!

Installed with drush and got this output...

The following extensions will be enabled: jqueryui_theme
Do you really want to continue? (y/n): y
WD php: trim() expects parameter 1 to be string, array given in /FOLDER/sites/all/modules/contrib/jqueryui_theme/jqueryui_theme.install on line 163.
WD php: in_array() expects parameter 2 to be array, null given in /FOLDER/sites/all/modules/contrib/jqueryui_theme/jqueryui_theme.install on line 169.
jqueryui_theme was enabled successfully.
trim() expects parameter 1 to be string, array given in /FOLDER/sites/all/modules/contrib/jqueryui_theme/jqueryui_theme.install on line 163.
in_array() expects parameter 2 to be array, null given in /FOLDER/sites/all/modules/contrib/jqueryui_theme/jqueryui_theme.install on line 169.
The directory /tmp/jqueryui_theme has been created.
The directory sites/all/files/jqueryui_theme has been created.
The directory sites/all/files/jqueryui_theme/base has been created.
The directory sites/all/files/jqueryui_theme/base/images has been created.
Extensions : zip have been added to default extensions uploaded files. See upload files settings. You could also configure it per role.

Still installed, but the importer doesn't work in D6. Perhaps it should just require placing in the right folder?
Here's the error output...

warning: Invalid argument supplied for foreach() in /FOLDER/sites/all/modules/contrib/jqueryui_theme/jqueryui_theme.module on line 1262.
warning: Invalid argument supplied for foreach() in /FOLDER/sites/all/modules/contrib/jqueryui_theme/jqueryui_theme.module on line 1218.
Cannot extract file uploaded, no archiver have been detected.
chaby’s picture

For the first error, could you tell me which version of php are you using ? I'm newbie but it seems that :
if ($var = variable_get('upload_extensions_default', NULL)) {//Do something} doesn't work properly depending on php version (?). I say that because it work fine for me with PHP 5.3.6. (check assignment rather than value returned ? If true, i have some cleanup code to do...).

Anyway, i have just simply changed it to :
$var = variable_get('upload_extensions_default', NULL); if ($var) {//Do some something} . Could you tell me if error still occured ?

Indeed, second error message is just a careless mistake ! But it means that you haven't zip extension php loaded : no zlib installed (PHP >= 5.2.0) or ZZIPlib (PHP 4). See. That why i have implement a hook_requirements() that you can check at admin/reports/status.

I'm still wooly about real environment requirements so correct me if i'm wrong.

This changes have been pushed on 6.x-1.x branch.

doublejosh’s picture

Yeah, I'm on PHP 5.2.13

Will test soon.

chaby’s picture

Sorry, I wasn't really awake when i wrote this !

For the first error, could you tell me which version of php are you using ? I'm newbie but it seems that :
if ($var = variable_get('upload_extensions_default', NULL)) {//Do something} doesn't work properly depending on php version (?). I say that because it work fine for me with PHP 5.3.6. (check assignment rather than value returned ? If true, i have some cleanup code to do...).

Also, it would't change anything. Could you tell me what contains the variable 'upload_extensions_default' ?
drush vget upload_extensions_default should return an array...(rather than a string as I expected)
I

chaby’s picture

Status: Active » Closed (fixed)

sounds resolved with last 6.x-1.0-alpha2

doublejosh’s picture

BTW: Here's the output... upload_extensions_default: "jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp"

This problem seems to still exist in 6.x-1.0-alpha2
Error is... Fatal error: [] operator not supported for strings in /home/recyclebetter/seabb/drupal/sites/all/modules/contrib/jqueryui_theme/jqueryui_theme.install on line 170

  $default_ext = array();
  if ($var = variable_get('upload_extensions_default', NULL)) {
    $default_ext = trim(explode(' ', $var));
  }
  $extensions = array('zip');
  foreach ($extensions as $key => $ext) {
    if (!in_array($ext, $default_ext)) {
      $default_ext[] = $ext; // LINE 170
    }
    else {
      unset($extensions[$key]);
    }
  }
doublejosh’s picture

You need to remove the trim() on 163.

doublejosh’s picture

Status: Closed (fixed) » Needs work

However, now it's stuck with: "The following file extensions are supported: . Maximun size..."

I dropped in another theme along side base in /default_themes but it doesn't register.

BTW: This page doesn't work: /admin/appearance/jqueryui-theme/example/MYTHEME

chaby’s picture

Status: Needs work » Needs review

Ok new release 6.x-1.0-alpha3 have been done.

You need to uninstall this module and install the new release as you have encounter some errors...

Before install new release, check if uninstall process have :

  • Clear tmp jqueryui_theme directory (in fact, it should doesn't matter...)
  • Clear files jqueryui_theme directory
  • variable "upload_extensions_default" still contains extensions previously declared

After install the new release :

  • take a look at /admin/reports/status at jQuery UI theme section if php zip module is enable
  • check if variable "upload_extensions_default" contains "zip" extension

Could you tell me if any errors still occured ?

If example pages don't work, which version of jQuery update module, jQuery UI module and jQuery UI theme are you using ? It seems that only 1.7 jQuery UI themes could be used (with of course a jQuery UI version of 1.7 and jQuery version 1.3). Appropriate js and stylesheets are loaded ?

doublejosh’s picture

BTW: Prior to a week ago, my upload_extensions_default did NOT include zip. So that was one piece of the problem... but that's just the upload tool.

  1. Removed sites/default/jqueryui_theme
  2. Confirmed drush vget upload_extensions_default includes zip
  3. Disabled jqueryui_theme
  4. Uninstalled jqueryui_theme
  5. Updated codebase.
  6. Installed jqueryui_theme
  7. Re-confirmed drush vget upload_extensions_default includes zip

Preview page works now for base!
Upload worked!*

Problems getting the new ones to register...

  • * I don't have an archiver. "Cannot extract file uploaded, no archiver have been detected."
  • Got around by manually unzipping via command line and moving the themes into sites/default/jqueryui_theme
  • Flushed cache. No other themes at /admin/build/themes/jqueryui-theme
  • Moved a theme to /contrib/jqueryui_theme/default_themes, flushed cache, still no other theme at /admin/build/themes/jqueryui-theme
  • Not sure what to try next to get them to show up.

Thanks for the attention.

chaby’s picture

OK sounds like you haven't zip php modules, isn't it ?

$ php --modules

I supposed that at /admin/reports/status, you have a requirement error about no archiver detected.

You can take a look in this case at this php doc to install it. Personally i have do it with PECL...instead of compile PHP

Indeed, unzip manually jQuery UI theme don't solve the problem as it should be register in database and make some checks (which are done during import process or for the default jQuery UI theme "base" at module install).

Loading zip php module solve the import problem ?

doublejosh’s picture

Gotcha. Didn't realize there were any database entries around the added themes.

I can't deal with recompiling PHP with --enable-zip at the moment, but I did manually place the database row and can successfully get the theme placed and editable on the settings page.

I think you can probably mark this as fixed.

chaby’s picture

Status: Needs review » Fixed

Thanks for your review

chaby’s picture

Status: Fixed » Closed (fixed)