Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2012-07-13 06:13:29

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 858
Website

Re: Textpattern's setup process

That’s pretty cool – top work fellas :)

I did notice a couple of things:

1 – When I made an error on purpose to use the Back buttons, in Firefox on a mac I kept getting:

Document Expired
This document is no longer available.
The requested document is not available in Firefox’s cache. As a security precaution, Firefox does not automatically re-request sensitive documents. Click Try Again to re-request the document from the website.

Clicking “Try again” worked and this is probably a browser thing, but just thought I’d mention it.

2 – If you don’t make a config.php file and place it in the textpattern directory, then there is no error message, it just doesn’t let you continue.

Offline

#12 2012-07-13 06:35:43

Gocom
Plugin Author
Registered: 2006-07-14
Posts: 4,524
Website

Re: Textpattern's setup process

tye wrote:

Clicking “Try again” worked and this is probably a browser thing, but just thought I’d mention it.

Yes it is. As the message states the page wasn’t found from your cache, and since Firefox doesn’t automatically repeat HTTP POST requests in normal circumstance (i.e. sending form twice would cause issues, like double posting and saves of the form etc), the browser is unable to go back.

That said, all multi-step forms, including these type of setup installations, will require their own go back/forward system. When you chain HTTP POST events/requests you will need to provide your own navigation method to go back, since you can’t relay on the browser. In case of documents requested via HTTP POST, the browser can only go back if the document is still in cache, which it may not be and may never have been especially if the form contains a password field or was used to transmit files.

As caching of form elements go, if there are form controls added via JavaScript, those will cause caching issues when moving back if own system/hooks aren’t provided. For instance, Firefox fills in wrong fields (node indexes don’t match on initial page load) and some other may not do a thing.

Offline

#13 2012-07-13 06:55:34

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,132
Website

Re: Textpattern's setup process

@tye

Good spot on issue 2, I’ll see if it’s possible to put a message in the config setup page. I’ve also noticed that if you create a config.php with different settings than those displayed then it also halts at this page with no extra warning message.

Offline

#14 2012-07-13 09:06:13

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,593
Website

Re: Textpattern's setup process

Quite an improvement (and I like the fact that one can choose an admin theme at the end of the process… one step less).

Questions: on two of the panes, a password must be input (first for the DB, then for the user password). Shouldn’t those fields be input[type=password] ? Ok, may be the first one is kinda moot as the whole thing is shown in the next step anyway, once ready to fill the config.php; for the second one, though, wouldn’t it be better ?

Last edited by phiw13 (2012-07-13 09:06:35)

Offline

#15 2012-07-13 09:27:56

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,132
Website

Re: Textpattern's setup process

@phiw13

Agreed – I’ve now made the admin account one a password type input. I’ve left the database one as a text input (r3960).

Offline

#16 2012-07-13 09:40:18

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,267
Website

Re: Textpattern's setup process

We’d rather have a “verify password” input then, too. Otherwise some people will have their caps-lock/num-lock on, mistype or otherwise fail to enter their desired password.

Offline

#17 2012-07-13 09:42:19

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,132
Website

Re: Textpattern's setup process

@wet

Ah, true. That’s too ‘programmy’ for me to do, you or Stef will have to add that, sorry.

Offline

#18 2012-07-13 09:44:43

jelle
Member
Registered: 2006-06-07
Posts: 165

Re: Textpattern's setup process

Bloke wrote:

as of Txp 4.5, you may put custom install code into /update/custom/post-update*.php which can be used to alter the DB on first install)

Interesting. How would that work exactly?
I’d still like a simple checkbox to prevent setup from filling the database with dummy articles, categories and stuff.

Offline

#19 2012-07-13 09:47:54

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,267
Website

Re: Textpattern's setup process

jelle wrote:

Interesting. How would that work exactly?

You copy a file named post-update-whatever.php into the /textpattern/update/custom/ folder when you upload Textpattern. Whenever your site is updated to a new Textpattern version these scripts are run at the end of the process. The actual implementation is completely up to you – you can even truncate database tables.

We suggest to adhere to this convention: Put custom code into file(s) at textpattern/update/custom/post-update-abc-foo.php where ‘abc’ is the third party’s reserved prefix (see Reserved plugin prefixes) and ‘foo’ is whatever you like. The execution order among all files is undefined.

Offline

#20 2012-07-13 09:51:35

Gocom
Plugin Author
Registered: 2006-07-14
Posts: 4,524
Website

Re: Textpattern's setup process

Did some more testing. The most error-prone issue I see is that the generated config.php file might not be valid PHP. The strings added to the config array aren’t sanitized or escaped correctly, and can lead to invalid PHP.

One the second, Add config file, step there seems to be some contradicting information when connection using specified credentials isn’t successful, but isn’t enough to invoke error messages:

Connected
Database does not exist or your specified user does not have permission to access it.

I mean is it OK or not? There are no errors, two paragraphs of text.

MySQL username […] database […] server

There is may be an unwanted behavior with these. It will proceed creating a MySQL link even if you don’t specify an user, server and database, all which should be required in this scenario.

When the MySQL user or server is left empty, the MySQL connection is created using either defaults set in server configuration or the current process owner. This may lead to successful link, but the user will end up with the options being empty in the generated config.php file. While things may work for now, this may cause issues in the long rung when and if the process owner changes etc. Relaying to this PHP’s MySQL extensions feature might not be the best idea, and user may accidentally fall to its victim. I would suggest making those fields mandatory. When a MySQL user, server or database is left empty, you could just skip creating the link and state that the options required to proceed.

Last edited by Gocom (2012-07-13 09:53:38)

Offline

Board footer

Powered by FluxBB