GetSimple Support Forum
GS3.1: Saving a page without a title clears page content. - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: GS3.1: Saving a page without a title clears page content. (/showthread.php?tid=2896)



GS3.1: Saving a page without a title clears page content. - hameau - 2012-03-08

Hello,

I know that this issue came up with v3.0 and non-Latin characters, but I think it's a more general weakness.

If an attempt is made to save a new page without adding a title, any existing page content is lost.

Although focus is given to the Title field when a new page is created, it is entirely possible that content may be created first – for example, by pasting text and subsequently editing or formatting it.

It is then all too easy to click the 'Save' button and lose everything, with just the 'Error: You cannot save a page with an empty title or slug.' for consolation.

Would it be possible to either disable the 'Save' button until mandatory fields are complete, or at least not discard any editor content, please ? It's a better fit with the Principle of Least Astonishment. ;-)


GS3.1: Saving a page without a title clears page content. - ccagle8 - 2012-03-08

agreed Hameau. I will add this to the issues list.


GS3.1: Saving a page without a title clears page content. - eatons - 2012-03-08

Here's a workaround [based on using the Innovation template] find the following page slug:

<h1><?php get_page_title(); ?></h1>

... add a class of hide,

<h1 class="hide"><?php get_page_title(); ?></h1>

and include that class in it's style sheet:

.hide {display: none;}

if using html5, [ Don't use the custom fields plug-in] ... just set up your own titling setup, for instance in an Hgroup:
<hgroup class="your class">
<h1>
----TITLE----
</h1>
<h2>
----SUB TITLE----
</h2>
</hgroup>


GS3.1: Saving a page without a title clears page content. - Carlos - 2012-03-09

I've tried removing (or commenting out) this in admin/changedata.php (GS 3.1):

Line 64:
Code:
}

and above, lines 39 to 41:
Code:
if ( $_POST['post-title'] == '' )    {
        redirect("edit.php?upd=edit-err&type=".urlencode(i18n_r('CANNOT_SAVE_EMPTY')));
    }    else {

Then, you get no error with pages with no title, and they are saved, but with slug temp, temp-1, temp-2 ...

For me this is acceptable (BTW it seems this may be how GS worked in some very old version), though maybe I'd change that default slug 'temp' to 'page'.


GS3.1: Saving a page without a title clears page content. - ccagle8 - 2012-03-09

@carlos - what shows up in the 'All Pages' section?


GS3.1: Saving a page without a title clears page content. - Carlos - 2012-03-09

They are listed like:
Code:
[No Title]  Ã‚»  temp-1
[No Title]  Ã‚»  temp-2
[No Title]  Ã‚»  temp
and you can edit them by clicking on the links.

(I expected that the links wouldn't be visible, but line 883 in template_functions.php does this.)


RE: GS3.1: Saving a page without a title clears page content. - hameau - 2012-11-08

Just fell for this again today, forgetting that my local mods had been reverted by a GS upgrade. Any news, please?


RE: GS3.1: Saving a page without a title clears page content. - n00dles101 - 2012-11-08

Hi,

This has been sorted since version 3.1.1.

Is there any reason why you haven't upgraded to that version.
There are lots of bug fixes since 3.1


RE: GS3.1: Saving a page without a title clears page content. - hameau - 2012-11-08

(2012-11-08, 21:38:33)n00dles101 Wrote: This has been sorted since version 3.1.1.

Apparently not – this is a clean install of 3.1.2.

Are you thinking of preventing saving a page with a whitespace or empty title/slug? I remember that being fixed.


RE: GS3.1: Saving a page without a title clears page content. - n00dles101 - 2012-11-08

8) Yes your right. Misread the origianl post..

I'll log an issue for it now.


RE: GS3.1: Saving a page without a title clears page content. - shawn_a - 2012-11-08

I thought we were still saving temp files or temp names if there was a problem.
hmm, we ought to.