Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
Re: TXP Mobile
@hotwebmatter
Surely it’s TXP 4.4.1 you’re using not TXP 4.1.1?
Offline
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
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
Re: TXP Mobile
Hi all
I’ve managed to put it up on github for those interested
Offline
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
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
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
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
#85 2013-04-07 07:36:22
- cynrise
- New Member
- Registered: 2013-04-07
- Posts: 1
Re: TXP Mobile
Warning: Cannot modify header information - headers already sent by (output started at ~/textpattern/theme/txpmobile/txpmobile.php:163) in ~/textpattern/lib/txplib_head.php on line 50
I registered just to post about this in case anyone else is still looking for how to fix this. Depending on your version, PHP will yell at you for sending any HTML before the headers. It does this in the break
In txpmobile.php around like 161-163, find this:
?>
<?php else: ?>
<?php
Remove the segmented PHP blocks to:
else:
Offline