Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am getting a problem with the file permissions on menu_icons.css
With every refresh of my page, menu_icons.css is regenerated from scratch and watchdog fills with errors about not being able to set the permissions. I can view the menu_icons just fine and have no problems with any other modules accessing my files directory.
I have changed the permissions to 777 and all variants, but the file is just removed and recreated with this:
-rw-rw-r-- 1 www-data www-data 1491 2011-06-25 14:25 menu_icons.css
What could I have done wrong?
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#7 | menu_icons-1200004-6.patch | 821 bytes | ewills |
#2 | menu_icons-1200004-2.patch | 821 bytes | skilip |
Comments
Comment #1
latulipeblanche CreditAttribution: latulipeblanche commentedI've got the same problem. While using "drush up" or "drush cc all" I get:
"$> sudo drush cc all" is working (Ubuntu)
Changing permissions doesn't change this.
Comment #2
skilip CreditAttribution: skilip commentedThe following patch should fix this
Comment #3
sonar_un CreditAttribution: sonar_un commentedThanks for the path. It cleared up the error in watchdog with file permissions, however the menu icons no longer show.
the menu_icons.css is created in css/menu_icons.css now as is proper, however, I now get this message when I try edit the menu icon from the menu page.
Warning: in_array() expects parameter 2 to be array, string given in menu_icons_form_submit() (line 142 of /sites/all/modules/menu_icons/menu_icons.module).
Thanks for your help with this.
Comment #4
sonar_un CreditAttribution: sonar_un commentedAfter finally having enough problems with this, I moved my temporary directory to sites/default/files/tmp and the problem is now gone.
Seems the patch resolved the issue.
Thanks for your help.
Comment #5
ewills CreditAttribution: ewills commentedHmm I tried this, including moving my temporary directory, but my icons still don't appear.
I'm getting the same issue with drush before I install the patch.
Once I've applied the patch, drush is fixed but my icons don't appear - looking at the HTML source of the generated page, the CSS file is being included from the correct directory (sites/default/files/css), however the css file itself is empty.
Any ideas?
Thanks,
Edwin
Comment #6
ewills CreditAttribution: ewills commentedAhha - fixed it.
Needed to change the line:
file_unmanaged_save_data($data, $csspath . '/menu_icons.css', FILE_EXISTS_REPLACE);
to
file_unmanaged_save_data($css, $csspath . '/menu_icons.css', FILE_EXISTS_REPLACE);
I'll quickly generate a new patch and post it up.
Comment #7
ewills CreditAttribution: ewills commentedPatch attached
Comment #8
dqdlast patch confirmed! thx
Comment #9
acrollet CreditAttribution: acrollet commentedCommitted in http://drupalcode.org/project/menu_icons.git/commit/c53ffc2, thanks!
Comment #11
acrollet CreditAttribution: acrollet commentedAs any FYI to anyone still seeing this issue, I committed http://drupalcode.org/project/menu_icons.git/commit/098d3fa, which solves problems with drupal and drush not saving the file as the same user.