the most recent cvs version is not saving the templates. This was broken in revision 1.8.4.53.

Comments

jrglasgow’s picture

Status: Active » Fixed
StatusFileSize
new1.39 KB

When 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.

Marc_PCR’s picture

Hi 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?

Marc_PCR’s picture

Sorry,

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)

jrglasgow’s picture

@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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.