01005: Publish button disabled if Drafts and PageTextVar() is used

Summary: Publish button disabled if Drafts and PageTextVar() is used
Created: 2008-01-31 00:56
Status: Closed - answered
Category: Bug
From: Anke
Assigned:
Priority: 3
Version: 2.2.0-beta65
OS:

Description: If I have Drafts enabled, and added the following unrelated to that to config.php

$CommentPage = 'Comments-{$FullName}';
$compage = PageTextVar($pagename, 'CommentPage');
if(!$compage) $compage = $CommentPage;
$FmtPV['$CommentPage'] = "'$compage'";

After that, the Edit link is still present in pages editable for everyone when I'm not logged in, but on the edit form the Publish button is greyed out/disabled.

The probem is definitive the PageTextVar(); if I replace that call with 'test' things work again.

I did not set $EnablePublishAttr, and even explicitly setting it to 0 did not help.

Neither did $EnablePublishAttr = 1; $DefaultPasswords['publish'] = '@nopass';

The normal edit form without draft mode works.


Hi!

I had the same problem I solved it seconds ago and perhaps this could help you: Make sure you DONT have any scripts included in your config.php wich set $EnableDrafts to 1.

I had $EnableDrafts = 0; in my config.php, but after that I included XESBlog, and inside the main script file for that recipe $EnableDrafts is set to 1...

Sorry for my bad English.

Simon

Hi. Such problems appear when some core functions are called and pages are opened before all authentications are set. To prevent this, you should call PageTextVar() near the bottom of your config.php. See Is the order of customizations in config.php important? --Petko July 07, 2009, at 09:53 PM