Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#73 2011-06-23 11:44:12

hotwebmatter
Member
From: Providence, RI, USA
Registered: 2011-06-17
Posts: 21
Website

Re: TXP Mobile

Nope! I spoke too soon — the problem returned.

Laptop user could not login due to invalid cookie, though the same user could login and logout without error on the iPhone. In order to reset the cookie, I had to temporarily rename the textpattern/theme/txpmobile theme, reload admin login URL, and then move the theme back. Login proceeded without error, but admin theme was reset to “Classic.”

If it happens again, I’ll try to post the exact errors I receive. Initially, I get the one I posted on 2011-06-21, which refers to line 165 of txpmobile.php and line 50 of txplib_head.php, but this does not prevent login. Later, when login fails, additional messages appear which point to cookie-related lines in include/txp_auth.php, but I didn’t keep detailed notes of them, unfortunately.

Luckily, none of these admin-theme shenanigans have any effect on the public-facing site, which has remained rock-steady through the entire debacle, and hopefully almost ready to launch.

Although frustrated, I’m also excited because I feel like we’re getting closer to nailing this.

Maybe in the next version of TXP Mobile, the code for the fallback theme could be revised so that the default fallback theme (e.g., “Remora”) would be called from a subdirectory like textpattern/theme/txpmobile/nonmobile_theme rather than hard-coded in the txpmobile.php file, so that users who wish to use TXP Mobile with another admin theme for non-mobile devices could just drop their preferred theme in that directory. (I’m not sure whether that would prevent conflicts, though.)

Meanwhile, I’m currently trudging through lib/txplib_theme.php and struggling to understand exactly how the admin theme is instantiated.

n00bishly yours,
Hot Web Matter


Well’s all that ends.

Offline

#74 2011-06-23 12:08:48

hotwebmatter
Member
From: Providence, RI, USA
Registered: 2011-06-17
Posts: 21
Website

Re: TXP Mobile

Here, as promised, are the exact error messages I receive (on non-mobile platforms only) when I set the default admin theme to “txpmobile”:

Warning: Cannot modify header information - headers already sent by (output started at /home/userid/public_html/textpattern/theme/txpmobile/txpmobile.php:165) in /home/userid/public_html/textpattern/include/txp_auth.php on line 184 Warning: Cannot modify header information - headers already sent by (output started at /home/userid/public_html/textpattern/theme/txpmobile/txpmobile.php:165) in /home/userid/public_html/textpattern/include/txp_auth.php on line 185 Warning: Cannot modify header information - headers already sent by (output started at /home/userid/public_html/textpattern/theme/txpmobile/txpmobile.php:165) in /home/userid/public_html/textpattern/lib/txplib_head.php on line 50 

… and down below that, the “Remora” theme login page appears with the message: “Invalid cookie. Please enter login details.”

This is with Textpattern version: 4.4.1 (r3575) and TXP Mobile 0.4.1 — please let me know if there is any other information I should share (verbose diagnostic output, perhaps?)

Last edited by hotwebmatter (2011-06-23 14:03:38)


Well’s all that ends.

Offline

#75 2011-06-23 12:14:46

oliverker
Plugin Author
From: Huddersfield
Registered: 2008-07-14
Posts: 90
Website

Re: TXP Mobile

hotwebmatter wrote:

This is with Textpattern 4.1.1

You need to be using txp v4.3+ for the latest txpmobile

Offline

#76 2011-06-23 14:01:30

hotwebmatter
Member
From: Providence, RI, USA
Registered: 2011-06-17
Posts: 21
Website

Re: TXP Mobile

Here’s another error message that sometimes crops up:

Notice: Undefined index: 0.4.1 in /home/userid/public_html/textpattern/theme/txpmobile/txpmobile.php on line 76 

I’m seeing this at the moment while logged in as the iPhone user, looking at http://www.hotwebmatter.com/textpattern/index.php?event=smd_at (the “Theme Selector” from smd_admin_themes) with Mozilla Firefox 4.0.1.

I’m also using the “UA Control” extension for Firefox to spoof User Agent string for Mobile Safari on iPhone, but only for www.hotwebmatter.com — I can also view the same site without the www while sending the regular Firefox UA string.

On iPhone user’s initial login, this page appeared as “Restricted Area” under Remora theme. I logged in to the alternate (no “www”) domain as non-mobile user and elevated iPhone user to “Publisher” level (without logging out the iPhone user first) and on page reload, the “Theme Selector” page displayed in TXP Mobile theme, with the error mentioned above.

It occurs to me that some of these errors may be due to changing settings for admin-side txp users while they are logged in, or attempting to login multiple times as the same user. That could definitely cause “invalid cookie” errors.

The other thing I’m wondering is whether my setup is too complex to debug effectively. Perhaps I should set up a brand-new, clean Textpattern 4.1.1 instance (with no plugins and only default themes) for debugging purposes, and then see whether I can duplicate these errors there.

I’m worried that I seem to be chattering to myself here. I don’t want to annoy anyone, or overwhelm the forum by over-sharing irrelevant information and inaccurate speculation. I’d like to keep my future posts as terse and pointed as possible, without leaving out any necessary info.

Does anyone have suggestions for effective troubleshooting?


Well’s all that ends.

Offline

#77 2011-06-23 14:02:54

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,561
Website GitHub Mastodon

Re: TXP Mobile

@hotwebmatter

Surely it’s TXP 4.4.1 you’re using not TXP 4.1.1?

Offline

#78 2011-06-23 14:10:05

hotwebmatter
Member
From: Providence, RI, USA
Registered: 2011-06-17
Posts: 21
Website

Re: TXP Mobile

I got rid of the Notice: Undefined index: 0.4.1 error by editing your manifest() function.

I changed

'version' 		=> $prefs['0.4.1'],

to

'version' 		=> '0.4.1',

and that cleared up right away.

Unfortunately, it didn’t help with the Invalid Cookie error.

Has anyone else managed to duplicate this error? If not, I suppose some plugin is the likely culprit, and I’ll need to test again with a clean install.

Last edited by hotwebmatter (2011-06-23 22:10:11)


Well’s all that ends.

Offline

#79 2011-06-23 14:12:01

hotwebmatter
Member
From: Providence, RI, USA
Registered: 2011-06-17
Posts: 21
Website

Re: TXP Mobile

philwareham wrote:

@hotwebmatter
Surely it’s TXP 4.4.1 you’re using not TXP 4.1.1?

Sorry, Oliver and Phil. I have corrected the typo above. I’m actually using the latest stable release: Textpattern version: 4.4.1 (r3575)


Well’s all that ends.

Offline

#80 2011-06-25 18:23:15

oliverker
Plugin Author
From: Huddersfield
Registered: 2008-07-14
Posts: 90
Website

Re: TXP Mobile

Hi all

I’ve managed to put it up on github for those interested

https://github.com/Oliverker/txpmobile

Offline

#81 2011-06-25 20:50:25

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

Re: TXP Mobile

oliverker wrote:

I’ve managed to put it up on github for those interested

Nice. You probably should remove your system files (Finder’s temporary cache) from there ;-)

As your last commit goes, you could (or, well, should) leave the version number in, just set it as a string. It’s one of the standard manifest items, and can be used to tell the user if the theme is up-to-date. You can also remove the global lines from the manifest() and did leave the last $prefs call there.

If you want to use preference strings, you can. Just remember that every non-core preference string should be prefixed, same goes for global scope functions, where it be JavaScript or PHP. In commands.js could be prefixing functions init and hideURLbar, both being relative common names to avoid interfering with other scripts, core and plugins.

Last edited by Gocom (2011-06-25 21:18:24)

Offline

#82 2011-06-26 22:38:52

hotwebmatter
Member
From: Providence, RI, USA
Registered: 2011-06-17
Posts: 21
Website

Re: TXP Mobile

@Oliver Ker:

Thanks for putting txpmobile in a git repository. If I change anything en route to getting my little mess sorted, I may even try to commit my changes back upstream — subject to your review, of course. :-D

I set up a new DNS A record and corresponding Apache2 <VirtualHost> entry for testing.hotwebmatter.com and created a new MySQL db for the back end, then installed Textpattern 4.4.1 successfully. All diagnostics passed — I can paste ‘em if you’d like.

This is a brand-new, virgin-clean install with no plugins of any sort — as a matter of fact, it doesn’t even have any articles yet.

Then I used git clone to pull txpmobile into a staging directory, and cp -R to copy the txpmobile theme into DocumentRoot/textpattern/theme/. I logged in as Publisher and set the default admin theme to txpmobile. As soon as I logged out, I was greeted with the now-familiar errors:

Warning: Cannot modify header information - headers already sent by (output started at /home/userid/testing.hotwebmatter.com/textpattern/theme/txpmobile/txpmobile.php:163) in /home/userid/testing.hotwebmatter.com/textpattern/include/txp_auth.php on line 214 Warning: Cannot modify header information - headers already sent by (output started at /home/userid/testing.hotwebmatter.com/textpattern/theme/txpmobile/txpmobile.php:163) in /home/userid/testing.hotwebmatter.com/textpattern/include/txp_auth.php on line 215 Warning: Cannot modify header information - headers already sent by (output started at /home/userid/testing.hotwebmatter.com/textpattern/theme/txpmobile/txpmobile.php:163) in /home/userid/testing.hotwebmatter.com/textpattern/lib/txplib_head.php on line 50 

… underneath which the standard Textpattern login screen displays “Invalid cookie. Please enter login details.”

As above, the same user logs in without error from my iPhone 3GS and sees your beautiful, gleaming TXP Mobile theme.

Line 163 in txpmobile.php is the beginning of the <?php block immediately following <?php else: ?>, so it appears that the problem only occurs upon fallback to txpmobile’s built-in copy of the “Remora” theme.

As before, I am able to reset the cookie by using mv to temporarily rename the txpmobile theme directory to something else (e.g., txpmobile-d, where the “d” is short for “disabled”). Upon reloading, I receive the following error:

cannot_instantiate_theme: txpmobile, txpmobile_theme, /home/userid/testing.hotwebmatter.com/textpattern/theme/txpmobile/txpmobile.php 

… but then after reversing the mv operation, I can log in from a non-mobile browser. (The admin-side theme reverts to “Classic” but can be set to “Remora” without error.)

I guess I should test this from some other browsers or other OS platforms. The latest test was with Firefox 5.0 on Fedora 15.

Let me know if you can duplicate the bug, or if there’s any additional information I could share that might help you.

Meanwhile, I may regretfully take a break from TXP Mobile for a little while, or downgrade to the oddly-implemented but functional v0.3 branch.

I’m also looking at some other possibilities involving CSS Media Queries and I might let the forum know how that works out for me (here, or under a more appropriate topic elsewhere).

Last edited by hotwebmatter (2011-06-26 23:22:26)


Well’s all that ends.

Offline

#83 2011-06-27 08:05:35

oliverker
Plugin Author
From: Huddersfield
Registered: 2008-07-14
Posts: 90
Website

Re: TXP Mobile

Gocom wrote:

oliverker wrote:

As your last commit goes, you could (or, well, should) leave the version number in, just set it as a string. It’s one of the standard manifest items, and can be used to tell the user if the theme is up-to-date. You can also remove the global lines from the manifest() and did leave the last $prefs call there.

Ok, Thanks, will get round to it

If you want to use preference strings, you can. Just remember that every non-core preference string should be prefixed, same goes for global scope functions, where it be JavaScript or PHP. In commands.js could be prefixing functions init and hideURLbar, both being relative common names to avoid interfering with other scripts, core and plugins.

This may help with a few of the bugs in there, Im no javascript of php dev (i copy and paste) but would love it if you could take a look (ie. fix it for me ; ) )

Cheers

Offline

#84 2011-11-08 14:18:24

brainseller
New Member
From: Nürnberg, Germany
Registered: 2011-11-08
Posts: 3
Website

Re: TXP Mobile

Same problem as hotwebmatter

I get warnings like
Warning: Cannot modify header information - headers already sent by (output started at /mnt/web2/30/07/5560907/htdocs/textpattern/theme/txpmobile/txpmobile.php:163) in /mnt/web2/30/07/5560907/htdocs/textpattern/lib/txplib_head.php on line 50
and the cookie problem on login

textpattern 4.4.1
txpmobile 0.4.1

only installed plugIn is zem_contact

Offline

Board footer

Powered by FluxBB