Closed (fixed)
Project:
Content Templates (Contemplate)
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
31 Dec 2008 at 04:00 UTC
Updated:
26 Jan 2009 at 21:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
jrglasgow commentedWhen the code in function contemplate_save($edit) was cleaned up it was not tested. This patch fixes the problem. I have already committed the patch, but I put it here for reference.
Comment #2
Marc_PCR commentedHi I have a problem with content template.
I am unable to save the template that I have created ( I was able about one week ago).
I don't know exactly what I have to do with your patch?
I have change the code in contemplate.module:
function contemplate_save($edit) {
$type = $edit['values']['type'];
$teaserfield = !empty($edit['values']['teaserfield']) ? $edit['values']['teaserfield'] : '';
$bodyfield = !empty($edit['values']['bodyfield']) ? $edit['values']['bodyfield'] : '';
$rssfield = !empty($edit['values']['rssfield']) ? $edit['values']['rssfield'] : '';
$enclosure = !empty($edit['values']['enclosure']) ? $edit['values']['enclosure'] : '';
$flags |= !empty($edit['values']['teaser-enable']) ? CONTEMPLATE_TEASER_ENABLED : 0;
$flags |= !empty($edit['values']['body-enable']) ? CONTEMPLATE_BODY_ENABLED : 0;
$flags |= !empty($edit['values']['rss-enable']) ? CONTEMPLATE_RSS_ENABLED : 0;
contemplate_delete($type);
$sql = "INSERT INTO {contemplate} (type, teaser, body, rss, enclosure, flags) VALUES ('%s', '%s', '%s', '%s', '%s', %d)";
return db_query($sql, $type, $teaserfield, $bodyfield, $rssfield, $enclosure, $flags);
}
But I still un able to save my templates?
May you help me?
Comment #3
Marc_PCR commentedSorry,
But I have jsut realise that my problem is not with content template
Since I have updated some module, I am unable to fill any a field a save it after.
I supoose than a discussion on content template is not the good place to talk about that, so do you know where I should post my question? (I am a newbie with drupal and drupal forum, sorry)
Comment #4
jrglasgow commented@Marc_PCR
I suppose I should ask you if you are using the CVS version of Drupal as a new user? If so that is a very brave thing to do.
The second question that I have is whether you know which module is causing the problem? Drupal works in such a way that any module can change the actions of any form on the site. If you don't know which module is causing the problem I would suggest you disable all contributed modules and check to make sure the forms are working. If they are then you should re-enable one contributed module at a time and test afterwards. When the forms stop working the last enabled module is probably the culprit. Leave that module enabled and start disabling the other modules one by one. If the other contributed modules are all disables but the one where the problem started you can be sure that the module in question is causing the problem and you can create an issue for that module.