unlcms / UNL-CMS

Drupal 7 implementation at the University of Nebraska–Lincoln
http://unlcms.unl.edu/
GNU General Public License v2.0
4 stars 13 forks source link

Let images larger than 1200x1200 be uploaded through imce #777

Open ericras opened 11 years ago

ericras commented 11 years ago

Problem: this settings page isn't accessible! https://unlcms.unl.edu/admin/config/media/imce/profile/edit/1/

ericras commented 11 years ago

Dumb module thinks the first imce profile should only be editable by the site's first user

imce/inc/imce.admin.inc

function imce_profile_operations($op = 'add', $pid = 0) {
  //add-edit
  if ($pid != 1 || $GLOBALS['user']->uid == 1) {
    return drupal_get_form('imce_profile_form', $pid);
  }
  drupal_access_denied();
}
ericras commented 11 years ago

https://drupal.org/node/1087568

ericras commented 11 years ago

Went in and updated it to 1920x1200 on unlcms.unl.edu by temp adjusting the code above then reverting the change.

ericras commented 11 years ago

IMCE settings/User-1 profile isn't shared, needs to be done on every site

ericras commented 11 years ago

Share the IMCE table(s)?

tsteiner commented 11 years ago

What IMCE tables? IMCE just uses imce_* variables.

ericras commented 10 years ago

Here's a query to change it to 1920x1200

UPDATE variable 
SET value = replace(CONVERT(value USING utf8), '1200x1200', '1920x1200')
WHERE name = 'imce_profiles'  
AND value LIKE '%1200x1200%';

This worked for me on my dev machine to update all sites:

drush @sites sqlq --db-prefix "UPDATE {variable} 
SET value = replace(CONVERT(value USING utf8), '1200x1200', '1920x1200')
WHERE name = 'imce_profiles'  
AND value LIKE '%1200x1200%';"
ericras commented 10 years ago

Running this on staging didn't work, fuuuuuuu-----

cd /var/www/htdocs
php sites/all/modules/drush/drush.php @sites sqlq -v --db-prefix "UPDATE {variable} SET value = replace(CONVERT(value USING utf8), '1200x1200', '1920x1200') WHERE name = 'imce_profiles' AND value LIKE '%1200x1200%';"

Running it locally works.

ericras commented 10 years ago

Running the mysql UPDATE query (https://github.com/unlcms/UNL-CMS/issues/777#issuecomment-30445409) on a single site's variable table works on staging.

Also, running drush on staging targeting a single site works:

php sites/all/modules/drush/drush.php -l http://unlcms-staging.unl.edu/chancellor/commencement/ sqlq  -v --db-prefix "UPDATE {variable} SET value = replace(CONVERT(value USING utf8), '1200x1200', '1920x1200') WHERE name = 'imce_profiles' AND value LIKE '%1200x1200%';"  
ericras commented 10 years ago

hmmm, on staging if you run

php sites/all/modules/drush/drush.php @sites status

it shows the Site Path as sites/default for every site

tsteiner commented 10 years ago

/var/www/bin/drush-all-sites.php status seems to work just fine, use that instead

ericras commented 10 years ago

This has just been run on production.

ericras commented 10 years ago

Not fixed on yet-to-be-created sites