Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-06-05 20:03:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

The curious case of the creeping status

I’ve been caught out with this before and couldn’t put my hands on what caused it. I think I’ve found a repeatable procedure that triggers some rather quirky behaviour. Please would somebody confirm it’s not just me and / or confirm if it’s just a Firefox/WIN issue or if it happens on other Browsers/OSs.

In TXP 4.2.0 under Firefox, do the following:

  1. Create an article and publish it with a status. Could be any status, but let’s choose hidden
  2. Hit Preview
  3. Instead of hitting Text to go back to your Textiled version, hit the browser’s Back button
  4. Note the article status has jumped down to Pending

If you had chosen Live as your status, hit Preview and then Back the status jumps to Sticky. This has caught me out a few times already where I’ve Previewed something in an existing article, flipped back to Textile view and committed the changes, then found the article disappears from the site because it’s gone Sticky.

From research, it appears to be a Firefox autocomplete issue. You can run an independent test to see it happening on page refresh, and Ryan Cramer has a write-up about it.

The question is, should anything be done about it in TXP, as Ryan suggests, to prevent this behaviour? Or should we just live with it because it’s a browser quirk and we shouldn’t pander to them?

Your thoughts please…


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2010-06-05 20:55:10

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: The curious case of the creeping status

I wouldn’t try to fix it. For one autocomplete isn’t a valid feature, and adding code that reselects the inputs might cause more trouble than it’s worth.

Not to mention, users can freely turn auto-complete off, if it causes problems. It’s not like they are forced to deal with buggy features that by any means are TXP’s fault. It’s browsers feature or a fault in this case.

As a personal thought, I would say that we shouldn’t be using Back button when posting forms anyways, especially when we have the cool tabs there. Does anyone actually use browser cache (Back/history) when dealing with forms? Atleast I don’t, because I for one have never trusted browsers when it comes to forms, redirects or ajax. Oh great it flushed cache while I took look at the other page and came back. Oh this page doesn’t accept cache.

Offline

#3 2010-06-05 20:56:53

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: The curious case of the creeping status

It doesn’t happen when I go back from the preview view, but it does when I reload the page using F5. And the status doesn’t jump down as you describe, but up. Not though when it is sticky. These are the changes after a reload:

sticky -> sticky
live -> pending
pending -> hidden
hidden -> draft
draft -> selection disappears! When trying to save the status-less article, an error occurs (of course):

Fatal error:

Error: ‘’ is not an integer

assert_int()
textpattern/include/txp_article.php:215 array_map()
textpattern/include/txp_article.php:56 article_save()
textpattern/index.php:141 include()

in /path/to/textpattern/lib/txplib_misc.php on line 2225

Browser/OS:

Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3

Offline

#4 2010-06-05 21:00:09

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: The curious case of the creeping status

Where is the auto-complete setting in Firefox? Can’t find it.

Offline

#5 2010-06-05 21:01:54

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: The curious case of the creeping status

Els wrote:

draft -> selection disappears! When trying to save the status-less article, an error occurs (of course):

Yep. There is no check for the data your browser sent. TXP expects that the items sent are valid and just Textile’s the body and sures that the values are escaped in SQL queries. Nothing wrong with that. Tho, that case could be fixed by checking if the status is there:

if(!in_array($Status,array(1,2,3,4,5))
	$Status = 4;

Offline

#6 2010-06-05 21:05:35

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: The curious case of the creeping status

Els wrote:

Where is the auto-complete setting in Firefox? Can’t find it.

Mozilla.com / kb / Form autocomplete

It’s same as form history feature. I have it off (for security and memory comsuption) and I have no issues with anything discussed here.

Offline

#7 2010-06-05 21:21:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: The curious case of the creeping status

Gocom wrote:

we shouldn’t be using Back button when posting forms anyways

True, but I sometimes forget and hit Back instead of remembering to hit the Text button. Force of habit. To me, and I guess to a lot of other people, we don’t care/notice whether the page we came from was a form submission or not; clicking Back should take us back to the previous page, exactly as we left it. That’s the cognitive assumption (and also, as you imply, the reason 95% of AJAX sites suck so badly!)

I agree it’s a browser issue and we should not waste time / energy battling browser bugs. Though Ryan’s fix simply turns off autocomplete locally for forms via jQuery so it’s not like we have to remember any states if this was implemented.

Els wrote:

Fatal error: Error: ‘’ is not an integer

Thanks for the report. Bizarre indeed. So Linux goes up, Windows goes down. Par for the course I guess! I’ve also had that fatal error thing before and never tracked down what caused it. Bet it was this issue, thanks for finally solving the mystery for me :-)

But what’s odd for me is that I — like Gocom — always have autocomplete off. It’s the first thing I do, besides telling the browser to never remember passwords for any sites. I just checked and it’s switched off, as it has been since day 1 of me using Firefox. But I still get the jumping radio statuses. Beeeezzzarrrrrre.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#8 2010-06-05 21:33:58

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: The curious case of the creeping status

Bloke wrote:

But what’s odd for me is that I — like Gocom — always have autocomplete off. It’s the first thing I do, besides telling the browser to never remember passwords for any sites. I just checked and it’s switched off, as it has been since day 1 of me using Firefox. But I still get the jumping radio statuses. Beeeezzzarrrrrre.

Yeah. I’ve got that too in the past. I’ve been trying for past couple minutes to replicate it, but I can’t. It doesn’t jump for me at the moment. It remembers everything as it was no mather what I do.

Offline

#9 2010-06-05 21:45:49

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: The curious case of the creeping status

Bloke wrote:

So Linux goes up, Windows goes down.

Nothing new there ;)

OK so I turned autocompletion off, and the behaviour is gone, but now every time I reload the page a new article is saved :)
And the radiobuttons still jump on that test page.

Last edited by els (2010-06-05 21:54:21)

Offline

#10 2010-06-14 15:00:02

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: The curious case of the creeping status

Gocom wrote

Not to mention, users can freely turn auto-complete off, if it causes problems. It’s not like they are forced to deal with buggy features that by any means are TXP’s fault. It’s browsers feature or a fault in this case.

To the average user this is all voodoo. A lot of people don’t even know the difference between google and a browser Users don’t care whether the browser is causing a problem or whether it is textpattern. They care that there’s a problem.

If there’s a quick fix , why would you not implement it? (“Other consequences” could be the answer to that question :-)

As a personal thought, I would say that we shouldn’t be using Back button when posting forms anyways, especially when we have the cool tabs there. Does anyone actually use browser cache (Back/history) when dealing with forms? Atleast I don’t, because I for one have never trusted browsers when it comes to forms, redirects or ajax.

I’m sure people do. And you can’t blame them for clicking back when they want to go back. :-)

Last edited by JanDW (2010-06-14 15:05:13)


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#11 2010-06-14 15:32:17

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: The curious case of the creeping status

JanDW wrote:

If there’s a quick fix , why would you not implement it?

Me personally? Bloke asked, and I gave my answer; I’m not saing I’m right..eous. The problem is that the fix isn’t even standard. Do you clean mess caused by others? I don’t. ;-)

Offline

Board footer

Powered by FluxBB