Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Big upgrade jump
skewray wrote #337071:
So, I removed ten years of accumulated redirects from my .htaccess (many pre-dating textpattern), and now the menus work.
Aha! we are getting somewhere there!
However, I was always sanity checking in a short window and missed some changes in behaviour.
On the landing page, 4.6.2 had no <Older & Newer> buttons, but in 4.7.3, they appear. The buttons do nothing when clicked. Code is
If you have less than 10 articles or so, then those buttons should not appear at all (and not be present in the source). If you have more, then something is amiss.
Do you have a link to the page in question?
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: Big upgrade jump
I sleuthed for a while and figured out that it is using the wrong page or section. Still working on sleuthing that. I can’t give a link because I revert back to 4.6.2 most of the time.
Okay, I am pretty sure at this point that my website from seven years ago was dodging some 4.6.2 idiosyncrasies that were fixed.
Last edited by skewray (2024-04-10 23:27:28)
Offline
Re: Big upgrade jump
Was there a reason why you didn’t or can’t upgrade to a more recent Txp and PHP version? (i.e. other scripts on your server). If not, you’d spare yourself the pain of the back and forth between 4.6.2 and 4.7.3 and dodging magic quotes settings by upgrading.
If nothing speaks against that, I think your site looks like it has good odds for upgrading. The only real plugin to consider is cbs_category_list. I took a look at it and largely uses in-built textpattern functions, so there’s a good chance it still works. You’ll just need to add this at the top of the plugin code to register the plugin tag:
if (class_exists('\Textpattern\Tag\Registry')) {
Txp::get('\Textpattern\Tag\Registry')
->register('cbs_category_list');
}
Otherwise txp:category_list will get you the same sidebar but without the article counts.
hpw_admin_css you may no longer need in the updated admin area, but you can use the custom.css method described above instead to add custom admin css. rah_nocache may not be necessary either after the PHP upgrade, but there is also “a newer version:https://github.com/gocom/rah_nocache/releases/tag/0.5.0 of that. If you had altered the caching settings in your .htaccess, that may have been affecting caching behaviour. Perhaps start with the stock .htaccess file and then start adding back in directives you wanted afterwards. Overall your site is not large – I’m guessing ~30-40 articles unless you have a lot of unpublished ones – so if there is a degree of manual work required, it’s done quickly.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Big upgrade jump
Now my site works on Txp 4.8.4, but breaks at 4.8.5 and 4.8.8. The code that breaks is below. Any idea what I need to do to get it to work on 4.8.5?
<form method="POST" action='/tools/<txp:article_url_title />' >
<txp:php>
$desc = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("pipe", "w")
) ;
$post = file_get_contents( 'php://input' ) ;
$command = parse( 'cgi-bin/<txp:yield />' ) ;
$process = proc_open( $command, $desc, $pipes ) ;
if( is_resource($process) ) {
fwrite( $pipes[0], $post ) ;
fclose( $pipes[0] ) ;
echo stream_get_contents( $pipes[1] ) ;
fclose( $pipes[1] ) ;
fclose( $pipes[2] ) ;
$return_value = proc_close( $process ) ;
}
</txp:php>
</form>
I am still at php 7.4.
Last edited by skewray (2024-04-11 18:04:09)
Offline
Re: Big upgrade jump
jakob wrote #337076:
Was there a reason why you didn’t or can’t upgrade to a more recent Txp and PHP version?[…snip…] Overall your site is not large – I’m guessing ~30-40 articles unless you have a lot of unpublished ones – so if there is a degree of manual work required, it’s done quickly.
Hi, Jakob. Thatnk you for the suggestions. Yesterday I removed 90% of my .htaccess content and over 50% of the Textpattern code (search, paginator, &c) that I didn’t need. I just disabled hpw_admincss and rah_nocache to see how that goes. cbs_category_list still works at 4.8.4, so I figure I will leave it until it breaks. I may rearrange to get rid of the block at the right; all it does is make another way to navigate, and the site isn’t really big enough to deserve that. The broken php above is now the major roadblock to upgrading.
Offline
Re: Big upgrade jump
skewray wrote #337077:
Any idea what I need to do to get it to work on 4.8.5?
Not sure about the content, but do you need to perhaps allow txp:php in articles (or similar) in Admin › Preferences? Something changed around that time with what was permitted.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Big upgrade jump
Ah, that was the issue. Now it all works on 4.8.8! I had to re-enable rah_nocache, as the admin side complained on every page load.
I then tried to upgrade to php 8.0. I got this lovely error:
Fatal error: Uncaught Error: Undefined constant "MYSQLI_CLIENT_FOUND_ROWS" in /textpattern/lib/txplib_db.php:169 Stack trace: #0 /textpattern/lib/txplib_db.php(288): DB->__construct() #1 /textpattern/publish.php(44): include_once('...') #2 l/index.php(69): include('/home/skewrayc/...') #3 {main} thrown in /textpattern/lib/txplib_db.php on line 169
(I removed the absolute paths to www/.) Is this cbs_category_list breaking?
Last edited by skewray (2024-04-11 19:53:04)
Offline
Re: Big upgrade jump
I saw that appear once earlier this evening on your site but on reload couldn’t make it happen again. I don’t see that anywhere now on your site (but you may have switched back). If you google for that error on the forum or elsewhere, it suggests you don’t have mysqli set up on your server but then the whole site wouldn’t work. If that is the case, check that for your PHP 8+ combination, mysqli is included. On some hosts you may have to set an extra checkbox for that.
If it was cbs_category_list, the error should mention it. It does do a combined query to get the categories and their article counts, but it’s not doing anything strange as far as I can see.
FWIW, this is plugin code:
/*
cbs_category_list v0.9
by Christophe Beyls [http://www.digitalia.be]
*/
if (class_exists('\Textpattern\Tag\Registry')) {
Txp::get('\Textpattern\Tag\Registry')
->register('cbs_category_list');
}
function cbs_category_list($atts)
{
global $s, $c;
extract(lAtts(array(
'label' => '',
'labeltag' => '',
'break' => 'br',
'wraptag' => '',
'parent' => '',
'posted' => '',
'section' => $s,
'sticky' => '',
'showcount'=> '',
'class' => __FUNCTION__,
'activeclass'=> ''
),$atts));
$parent = ($parent) ? " AND c.parent = '$parent'" : '';
$showcount = ($showcount == 'true') ? ', COUNT(*) AS count' : '';
$sticky = ($sticky == 'true') ? '5' : '4';
switch($posted) {
case 'all':
$posted = '';
break;
case 'future':
$posted = ' AND t.Posted >= now()';
break;
default:
$posted = ' AND t.Posted < now()';
}
if($section == 'default') {
$table = ', `'.PFX.'txp_section` AS s';
$sqlsection = 's.name AND s.on_frontpage = 1';
} else {
$table = '';
$sqlsection = "'$section'";
}
$rs = startRows(
'SELECT c.name, c.title'.$showcount.' FROM `'.PFX.'txp_category` AS c, `'.PFX.'textpattern` AS t'.$table
.' WHERE (c.name = t.Category1 OR c.name = t.Category2) AND c.type = \'article\' AND t.Section = '.$sqlsection.$parent.$posted
.' AND t.Status = '.$sticky.' GROUP BY c.name ORDER BY c.title'
);
if(!$rs)
return '';
$count = '';
$out = array();
while($a = nextRow($rs)) {
extract($a);
$out[] = tag(str_replace('& ','& ', $title), 'a', ' href="'.pagelinkurl(array('c'=>$name, 's'=>$section))
.(($activeclass && ($s == $section) && ($c == $name)) ? '" class="'.$activeclass.'"' : '"')).($count ? ' ('.$count.')' : '');
}
return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
}
TXP Builders – finely-crafted code, design and txp
Offline
Re: Big upgrade jump
skewray wrote #337081:
I had to re-enable rah_nocache, as the admin side complained on every page load.
What does it complain about?
TXP Builders – finely-crafted code, design and txp
Offline
Re: Big upgrade jump
Site works on php 8.1! Just not php 8.0, for some reason that I don’t need to know.
Without rah_nocache, Firefox creates a pop-up on every admin webpage load requesting a force reload. Opera doesn’t have this issue.
Thank you, everyone! I am going to consider my site fully updated at this point.
Offline
Re: Big upgrade jump
skewray wrote #337085:
Site works on php 8.1! Just not php 8.0, for some reason that I don’t need to know.
Without rah_nocache, Firefox creates a pop-up on every admin webpage load requesting a force reload. Opera doesn’t have this issue.
Thank you, everyone! I am going to consider my site fully updated at this point.
Congratulations!
Do you have any adblocker or similar active in Firefox – in addition to the already mentioned noscript extension. I think you need to completely whitelist your site, as there is lots of js at work on the admin pages. And again, the browser console might give a hint about potential issues or conflicts.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: Big upgrade jump
My Firefox has NoScript and an Ghostery. I test it in a no-cache version of Opera, and if it works there, I am okay with it. And it does! For now, I can happily leave rah_nocache enabled to make Firefox happy.
Offline