Unable to Save CSS File
deepseajunky - September 22, 2007 - 18:54
| Project: | Alter CSS |
| Version: | 5.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I'm unable to get this module to save a New css file. I've gone into the theme and can see the new CSS fields. I can copy/paste the Backup into a New CSS but when I click Save File the screen refreshes and nothing is saved. I've tried on multiple themes with the same results. In going into the theme for the first time it does save the backup file so at the file/folder lever permissions are correct. Not sure what else to check, even installed AJAX Session module just to rule that out, and no luck.
Thanks, look forward to using this module.

#1
I'll try to see if I recreate the bug you're describe. As it is right now, its working on my site Shawn Conn.com. Also, note AJAX Session is not a required module for Alter CSS to work. The README reference in the 1.0 release was ,regrettably, the result of creating multiple README files at one time and not enough proofreading.
#2
same problem here, the file simply won't save.
#3
methinks this module requires on PHP5. I debugged using firebug, got an error along the lines of:
Fatal error: Call to undefined function: file_put_contents() in /public_html/sites/all/modules/alter_css/alter_css.module on line 172
searched and found http://drupal.org/node/90713, which contains a solution that seems to fix the "css won't save" problem.
#4
I've running my website under php 4.3 and had the same problem with the module.
With some googleing i found that the function file_put_contents was introduced with php 5.0.
Would you please add some lines to your readme file of the plugin, or add the lines:
if(!function_exists('file_put_contents')) {
function file_put_contents($filename, $data, $file_append = false) {
$fp = fopen($filename, (!$file_append ? 'w+' : 'a+'));
if(!$fp) {
trigger_error('file_put_contents cannot write in file.', E_USER_ERROR);
return;
}
fputs($fp, $data);
fclose($fp);
}
}
to your file alter_css.module.
For all others, having the same problem: Edit the file alter_css.module and add the lines above at the end of the file.
Greeting
Kadmos
#5
Sorry for the late reply. Instead of implementing the function above, I've just replaced the file_put_contents() with fopen() & fwrite() which will accommodate PHP 4 users.
#6
Implemented in release 1.1, set to active if issue still continues.
#7
Automatically closed -- issue fixed for two weeks with no activity.