Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-05-07 14:13:19

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Plugins broken in 4.6

Edit: Aside from restructured admin HTML, there are some code changes in Textpattern 4.6 that might lead to misbehaving plugins. Some nice people (Bloke, ruud and michaelkpate) have set up forum posts in order to bring possible plugin issues to your attention and offer fixes for those. Here’s the list of these postings:

Tag registering 1 (basic examples)
Tag registering 2 (advanced examples)
NULLDATETIME
Converting plugins to mysqli

——————— ORIGINAL POST ———————

esq_sectionsort

Broken feature: Sorting of categories

Can be fixed with:

Find

#category_container .category-tree > .categorysort:first-child {

Replace by

#category_article_form > .categorysort:first-child,
#category_image_form > .categorysort:first-child,
#category_file_form > .categorysort:first-child,
#category_link_form > .categorysort:first-child {

________________________________________________________________________________________

Find

#category_container .category-tree p .handle {

Replace by

#category_article_form p .handle,
#category_image_form p .handle,
#category_file_form p .handle,
#category_link_form p .handle {

________________________________________________________________________________________

Find

$('#category_container .category-tree').each(function() {

Replace by

$('#category_article_form,
#category_image_form,
#category_file_form,
#category_link_form').each(function() {

________________________________________________________________________________________

Some cosmetics:

Find second instance of

set_message('Section order saved OK', 'success')

Replace by

set_message('Category order saved OK', 'success')

________________________________________________________________________________________

Find second instance of

set_message('Section order save failed', 'error');

Replace by

set_message('Category order save failed', 'error');

________________________________________________________________________________________

Remove

.css('table-layout', 'fixed')

(Keeps the section table from shrinking in 4.6 when toggling “Show details”.)

________________________________________________________________________________________

Find

$('#section_container thead tr').prepend('<th style="width: 30px;">Sort</th>').find('th').each(function() {

Replace by

$('.txp-list th').removeClass('asc').removeClass('desc');
$('#section_container thead tr').prepend('<th style="width: 30px;">Sort</th>').find('th').each(function() {

(Removes the classes for chosen table sorting column headers in the Sections panel. You can’t sort that table, when the plugin is installed.)

Edit: Added the last two cosmetic fixes.

Last edited by uli (2016-12-02 19:11:18)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#2 2016-05-07 14:27:52

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: Plugins broken in 4.6

stm_article_order

Broken feature:
Completely broken

Can be fixed with:
Hopefully: some compatibility changes to adapt the plugin to Textpattern 4.6’s current jQuery version (v1.12.3). It works again as soon as Textpattern 4.5.7’s jQuery v1.8.3 is used in /textpattern/lib/txplib_head.php

If you know what changes need to be done, please post here. Thanks. done

Last edited by uli (2016-12-02 19:10:16)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2016-05-09 09:57:46

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

Re: Plugins broken in 4.6

[stm_article_order] If you know what changes need to be done, please post here.

The primary issue is that jQuery.browser no longer exists so browser detection is out. Trawl the code for any mention of jQuery.browser and remove / replace it. List of possible fixes are below. Note that ones marked with an asterisk may potentially break Opera, so require testing.

Lines 390 + 391: remove check for Opera*

x += el.offsetLeft + (el.currentStyle ?parseInt(el.currentStyle.borderLeftWidth)||0:0);
y += el.offsetTop + (el.currentStyle ?parseInt(el.currentStyle.borderTopWidth)||0:0);

Lines 619, 677, and 1056: remove reference to jQuery.browser.msie and use a different IE-specific check (does it support ActiveX)

if(window.ActiveXObject) {

Lines 752 + 753: remove reference to jQuery.browser.msie and Opera-specific test*

elm.dragCfg.oC.x = elm.offsetLeft + (window.ActiveXObject ? 0 : parentBorders.l);
elm.dragCfg.oC.y = elm.offsetTop + (window.ActiveXObject ? 0 : parentBorders.t);

That at least allows dragging again, but as I say, there are Opera-specific tests that have been removed, which may need to be addressed with some clever tests. With luck, the tests may not be required any more since Opera changed their rendering engine. Whether there’s anything more that needs fixing after that remains to be seen.


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

#4 2016-05-09 13:48:45

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: Plugins broken in 4.6

Ah, Stef, thanks! That brought it back to life. During the weekend I’ve tried to follow some blog tips but only tore my hair, so I ended up dropping in the migrate plugin, for the cost of yet another 10kb. Much better now!

Need to align some changes with the stm_ao-migrate version now and see what happened with the GIF/PNG part that got lost somewhere (not contained in v0.3). And throw in again Claire/cbe’s change, and then it’s ready for some nice folks that want try the mangy beast, esp. on Opera.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#5 2016-06-03 16:56:16

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: Plugins broken in 4.6

What about Jukka plugins ?

rah_knots and
rah_post_versions

don’t works well.

rak_knots = save only on the write tab (not on page or form)
rah_post_version = many mysql errors.

Offline

#6 2016-06-03 17:31:22

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: Plugins broken in 4.6

jpdupont wrote #299489:

rah_knots

That’s an easy “fix” (if it’s not that way by design):

Look for (2 x)

$('form .publish')

Replace by (2 x)

$('form .publish, #page-form .publish, #page-page .publish, #page-css .publish')

rah_post_versions

IIRC Jukka has announced to drop support for that plugin some years ago. Personally, I’ve regretted that and I still do. I hope someone wants to fix that plugin and make it available to the community.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#7 2016-06-04 07:48:48

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: Plugins broken in 4.6

@uli

I don’t know if it’s really correct but this modification seems to work :

$setid = safe_insert(
	'rah_post_versions_sets',
	"modified=now(),
	changes=1,
	title='".doSlash($title)."',
	event='".doSlash($event)."',
	step='".doSlash($step)."',
	grid='".doSlash($grid)."'"
	);
	// $setid =  mysql_insert_id();

Move the $setid = before the safe_insert ... and comment the $setid = mysql_insert_id();

Offline

#8 2016-06-04 15:26:40

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: Plugins broken in 4.6

Hi, Jean-Pol, that’s a good one, thanks! My most important fields are working (forms, pages, CSS). Except for article, which will become the most important one once the website is handed over to the clients. Did article save ever work in rah_post_versions after the move to AJAX saving? (Very likely I didn’t use it any more because of that but I really can’t remember.)

I’ve a vague feeling it might simply be the the ident code for article in the plugin preferences:

	case "article":
		$grid = rah_post_versions_id();
		$title = gps("Title");
	break;

But I’ve no idea what to change about that.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#9 2016-06-04 16:36:53

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: Plugins broken in 4.6

Yes.
maybee in this list article:edit, article:create, article:publish, article:save, because it seems the event is not fired for article.

Offline

#10 2016-06-04 20:45:16

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Plugins broken in 4.6

uli wrote #299519:

Did article save ever work in rah_post_versions after the move to AJAX saving?

No, only the first time when it was published.

Last edited by GugUser (2016-06-05 02:41:58)

Offline

#11 2016-06-05 02:32:18

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Plugins broken in 4.6

uli wrote #299491:

That’s an easy “fix” (if it’s not that way by design)

With your easy fix it works on my 4.6 beta installation.

Where could be published the new version?

Here the code:

# Name: rah_knots v0.2.1 
# Type: Admin plugin
# Command+Save editors
# Author: Jukka Svahn
# URL: http://rahforum.biz
# Recommended load order: 5

# .....................................................................
# This is a plugin for Textpattern CMS - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................

YToxMTp7czo0OiJuYW1lIjtzOjk6InJhaF9rbm90cyI7czo2OiJhdXRob3IiO3M6MTE6Ikp1
a2thIFN2YWhuIjtzOjEwOiJhdXRob3JfdXJpIjtzOjE5OiJodHRwOi8vcmFoZm9ydW0uYml6
IjtzOjc6InZlcnNpb24iO3M6NToiMC4yLjEiO3M6MTE6ImRlc2NyaXB0aW9uIjtzOjIwOiJD
b21tYW5kK1NhdmUgZWRpdG9ycyI7czo0OiJjb2RlIjtzOjIyNzQ6Ii8qKg0KICogcmFoX2tu
b3RzIHBsdWdpbiBmb3IgVGV4dHBhdHRlcm4gQ01TLg0KICoNCiAqIEBhdXRob3Ig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NpYmxpbmdzLjwvbGk+CgkJPGxp
PkNoYW5nZWQ6IFJlc2VydmUgc3BhY2UgZm9yIHRoZSB0aXAgbGFiZWwgaW5zdGVhZCBvZiBv
dmVybGF5aW5nIGNvbnRlbnQuPC9saT4KCQk8bGk+Q2hhbmdlZDogSGlkZSB0aGUgdGlwIGxh
YmVsIG9uIGJ1dHRvbiBjbGljay48L2xpPgoJPC91bD4KCgk8aDM+VmVyc2lvbiAwLjEgJiM4
MjExOyAyMDEyLzA4LzMwPC9oMz4KCgk8dWw+CgkJPGxpPkluaXRpYWwgcmVsZWFzZS48L2xp
PgoJPC91bD4iO3M6MzoibWQ1IjtzOjMyOiIyOTU2MTA5OThmZDhhNzgwZDMwZTJmNzU2NmEw
Zjk2OCI7fQ==

Last edited by GugUser (2016-06-19 19:01:34)

Offline

#12 2016-06-05 02:35:50

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Plugins broken in 4.6

uli wrote #299034:

Ah, Stef, thanks! That brought it back to life. During the weekend I’ve tried to follow some blog tips but only tore my hair, so I ended up dropping in the migrate plugin, for the cost of yet another 10kb. Much better now!

Need to align some changes with the stm_ao-migrate version now and see what happened with the GIF/PNG part that got lost somewhere (not contained in v0.3). And throw in again Claire/cbe’s change, and then it’s ready for some nice folks that want try the mangy beast, esp. on Opera.

Do you work on this?

Offline

Board footer

Powered by FluxBB