Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#337 2016-02-17 09:59:51
- MatthijsR
- New Member
- Registered: 2016-01-18
- Posts: 5
Re: bot_write_tab_customize: rearrange and style items in the write tab
Hi guys,
I’ve found out about this plugin a couple of months ago and I’ve used it for a couple of sites now, in combination with glz custom fields. This is an immense improvement for people to get around in the write tab. Great stuff!
Atm I’m experiencing an issue and I just can’t find what the problem is. It worked fine for a while. But for some reason now, when I try adding any sort of new rule or alter an existing one, saving doesn’t work and I don’t get any form of notification.
Sometimes it just jumps to the top of the page and the url changes from http://website/index.php?event=bot_wtc_tab to http://website/index.php. But most of the time it jumps back to the articles root (my starting page after login).
I can alter the rows in the database and then it works. But this clearly isn’t how it’s supposed to work.
Can someone help me with this?
A big thanks in advance!
Offline
#338 2016-02-17 15:55:37
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
Hi MatthijsR,
I fear you have the suoshin module installed on your server.
This was already discussed here.
Offline
#339 2016-03-01 13:15:05
- MatthijsR
- New Member
- Registered: 2016-01-18
- Posts: 5
Re: bot_write_tab_customize: rearrange and style items in the write tab
redbot wrote #297889:
Hi MatthijsR,
I fear you have the suoshin module installed on your server.
This was already discussed here.
Thanks redbot! It’s quite difficult to find specific problems in such long threads… Tried searching but probably used the wrong words. I’ll try and alter that config file. Hope this won’t clear out my preferences. Backing up just in case.
Offline
#340 2016-05-19 19:14:49
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: bot_write_tab_customize: rearrange and style items in the write tab
On a new Textpattern 4.6 dev version, with an only plugin, a working glz_custom_fields 1.4.0-beta1, I tried to install this bot_write_tab_customize beta. But it was not possible.
When I activated the plugin, first appeared a few times this error message:
User_Error “Table ‘textpattern.bot_wtc’ doesn’t exist”.
When I tried to run the installation, then appeared this error message:
Fatal error: Uncaught Error: Call to undefined function mysql_get_server_info() in /Applications/MAMP/htdocs/textpattern/textpattern/lib/txplib_misc.php(1783) : eval()’d code:271 Stack trace: #0 /Applications/MAMP/htdocs/textpattern/textpattern/lib/txplib_misc.php(1783) : eval()’d code(536): bot_wtc_install() #1 /Applications/MAMP/htdocs/textpattern/textpattern/lib/txplib_misc.php(1896): bot_wtc_tab(‘bot_wtc_tab’, ‘install’) #2 /Applications/MAMP/htdocs/textpattern/textpattern/index.php(214): callback_event(‘bot_wtc_tab’, ‘install’, 0) #3 {main} thrown in /Applications/MAMP/htdocs/textpattern/textpattern/lib/txplib_misc.php(1783) : eval()’d code on line 271
Is there an explanation for this?
Offline
#341 2016-05-19 20:26:11
Re: bot_write_tab_customize: rearrange and style items in the write tab
Are you perhaps on PHP 7? The error occurs in the very first line of the function bot_wtc_install
. A comment in that function reads // figure out what MySQL version we are using (from _update.php). If you look at _update.php from version 4.5.x, it uses that method to use switch notation depending on whether on MySQL 4 or 5. The newest version of _update.php
does away with that method completely (I think that happened in this commit).
What if you edit that function in the plugin and delete the bit between figure out which MySQL version… up to (but not including) set_pref and replace it with a reduced version:
$tabletype = " CHARACTER SET = ". $txpcfg['dbcharset'] ." ";
// Create the bot_wtc table
$bot_wtc = safe_query("CREATE TABLE `".PFX."bot_wtc` (
`id` INT NOT NULL AUTO_INCREMENT,
`item` VARCHAR(255) NOT NULL,
`position` VARCHAR(255) NOT NULL,
`destination` VARCHAR(255) NOT NULL,
`sections` TEXT NOT NULL,
`class` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM $tabletype");
i.e. If you’re on PHP7, you’ll also be on a more recent version of MySQL, so you can do away with the old test and just bring in the charset.
TXP Builders – finely-crafted code, design and txp
Offline
#342 2016-05-19 20:46:30
Re: bot_write_tab_customize: rearrange and style items in the write tab
Jakob’s right. undefined function mysql_*()
is a symptom of a plugin that uses MySQL calls that have been removed from PHP in version 7. Another “solution” (albeit short term) is to check what Ruud has done in core: he’s replaced mysql_*()
calls with mysqli_*()
calls to buy us some time. The usual solution is to convert:
mysql_some_function();
into:
global $DB;
...
mysqli_some_function($DB->link);
The problem then usually goes away. Though in this particular function’s case, we’ve already computed the value so you should be able to do away with the function call entirely and just use the value directly wherever it needs the MySQL version number:
global $DB;
...
$DB->version;
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
#343 2016-05-20 02:20:20
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: bot_write_tab_customize: rearrange and style items in the write tab
Thank you jakob and Bloke for your answers.
jakob wrote #299157:
Are you perhaps on PHP 7?
Yes.
I tried to implement your suggestions, but with each new installation comes the same error message:
User_Error “Table ‘textpattern.bot_wtc’ doesn’t exist”.
Later I changed to PHP 5.6.1, but I could not install the original bot_write_tab_customize v0.7.4beta plugin. The same error message.
The subject of the experiment was to find out, whether both plugins, glz_custom_fields 1.4.0-beta1 and bot_write_tab_customize v0.7.4beta might work together. That’s crucial for me to decide if I will be able in the near (near?) future to update to Textpattern 4.6.
Offline
#344 2016-05-20 03:58:08
Re: bot_write_tab_customize: rearrange and style items in the write tab
GugUser wrote #299164:
The subject of the experiment was to find out, whether both plugins, glz_custom_fields 1.4.0-beta1 and bot_write_tab_customize v0.7.4beta might work together. That’s crucial for me to decide if I will be able in the near (near?) future to update to Textpattern 4.6.
I need both of these too, for most of my Txp installations.
Last edited by johnstephens (2016-05-20 03:58:21)
Offline
#345 2016-05-20 06:37:11
Re: bot_write_tab_customize: rearrange and style items in the write tab
redbot can probably deal with this much better than me, but I looked a little further at the txp source and it seems the db-prefix/engine/type/charset stuff is all now incorporated into the in-built txp functions and that there is an own create table function in txp.
What if you replace the whole bot_wtc_install
function with this?
function bot_wtc_install()
{
// Create the bot_wtc table
safe_create('bot_wtc',"
id INT NOT NULL AUTO_INCREMENT,
item VARCHAR(255) NOT NULL,
position VARCHAR(255) NOT NULL,
destination VARCHAR(255) NOT NULL,
sections TEXT NOT NULL,
class VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
");
// entries in txp_prefs table
set_pref ('bot_wtc_script','', 'bot_wtc_','2');
set_pref ('bot_wtc_static_sections','', 'bot_wtc_', '2');
}
TXP Builders – finely-crafted code, design and txp
Offline
#346 2016-05-21 01:22:37
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: bot_write_tab_customize: rearrange and style items in the write tab
jakob wrote #299168:
What if you replace the whole
bot_wtc_install
function with this?
function bot_wtc_install()...
I made a new Textpattern 4.6. dev installation with a new database and tried to install bot_wtc with your proposed changes as the first plugin, but:
User_Error “Table ‘textpattern.bot_wtc’ doesn’t exist”.
This is the plugin with “your” changes.
Offline
#347 2016-05-22 02:27:36
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: bot_write_tab_customize: rearrange and style items in the write tab
For a new experiment I wanted to do an online Textpattern 4.6 dev installation. After the first login, an error message was displayed and I couldn’t do anything (PHP version 5.5.19):
User_Error “INDEX command denied to user ‘web111’@‘localhost’ for table ‘txp_css’”
in /home/www/web111/html/versuch/textpattern/lib/txplib_db.php at line 405.
textpattern/lib/txplib_misc.php:1677 adminErrorHandler()
updateErrorHandler()
textpattern/lib/txplib_db.php:405 trigger_error()
textpattern/lib/txplib_db.php:666 safe_query()
textpattern/update/_to_4.6.0.php:168 safe_drop_index()
textpattern/update/_update.php:84 include()
textpattern/index.php:180 include()
I made a second installation with the result of the same error message.
The experiment with the plugin wasn’t possible.
Offline
#348 2016-05-22 22:36:45
Re: bot_write_tab_customize: rearrange and style items in the write tab
See if this one works better for you:
EDIT: code deleted – see below
Important: Textpattern v4.6 only and beta. I’ve shifted the install/uninstall from the buttons on the extension panel to the regular plug install/deinstall routines and installing appears to work with my testing. I also made the tables only delete on deleting the plugin, not on deactivating plus some further modifications. There’s more that could be done, like switching error messages to using the built-in txp system and some legacy stuff that I think needs taking out / converting for use with the new div-layout like the handling of tables from the old layout.
I hope it works for you!
TXP Builders – finely-crafted code, design and txp
Offline