Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1156 2017-05-01 08:24:22
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: glz_custom_fields
phiw13 wrote #305566:
Simple one? Don’t use TXP -dev for production or demonstration work. There are still way too many things in flux.
Yes, phiw13, I know, I know …
However in the latest versions 4.7 dev there are some very interesting features that become indispensable. The dev versions of txp are slow to become official, and even at this time (official release), there are too many plugins that will no longer work or cause errors. Will actual glz_custom_fields be repaired at 4.7 ??? And custom fields in core are not provided before … 4.8 ???
Offline
#1157 2017-06-28 10:34:53
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: glz_custom_fields
@phiw13
I searched for why glz_custom_fields no longer works with the latest versions 4.7 dev.
I discovered that at times the html value of the custom field preferences would go back to custom_set instead of staying at the value assigned by glz_custom_fields.
After looking without success in the plugin code what does a reset of these values, I realized it happened at new login.
By commenting checkprefsintegrity in txp_auth, no more bug after a logout / login.
function checkPrefsIntegrity() is in /textpattern/vendors/Textpattern/DB/Core.php
github.com/textpattern/textpattern/issues/907Last edited by jpdupont (2017-06-28 11:05:15)
Offline
#1158 2017-06-29 22:49:40
Re: glz_custom_fields
jpdupont wrote #306111:
I discovered that at times the html value of the custom field preferences would go back to custom_set instead of staying at the value assigned by glz_custom_fields.
Thanks for the debugging! I see that makss has offered a patch that would potentially fix this. I’ll have to test next, perhaps over the WE.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#1159 2017-07-03 00:14:49
Re: glz_custom_fields
Upon install (TXP4.7-dev up-to-date – using v1.5.0b from Stefs repo):
User_Error "Specified key was too long; max key length is 1000 bytes"
in /Users/XXX/Sites/_txp47/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
textpattern/lib/txplib_db.php:409 trigger_error()
textpattern/lib/txplib_misc.php(1407) : eval()'d code:1285 safe_query()
glz_custom_fields_install()
textpattern/lib/txplib_misc.php:1948 call_user_func_array()
textpattern/include/txp_plugin.php:565 callback_event()
textpattern/include/txp_plugin.php:50 plugin_install()
textpattern/index.php:222 include()
After activating the extension and creating a new field (a simple text_input) – in the UI the field is not visible (not in the extensions tab, not on the Write panel:
User_Error "Unknown column 'prefs_id' in 'field list'"
in /Users/XXX/Sites/_txp47/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
textpattern/lib/txplib_db.php:409 trigger_error()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:361 safe_query()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:89 glz_new_custom_field()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:1458 glz_custom_fields_MySQL()
glz_custom_fields()
textpattern/lib/txplib_misc.php:1948 call_user_func_array()
textpattern/index.php:225 callback_event()
Checking with Sequel Pro, I see that the custom fields table does not exist. However, I find a custom_11 entry in the textpattern table.
The good thing: my preexisting custom fields (custom_1 – custom_4) are never affected by this. Login out and logging in, the fields remain (functional).
On another test install, where the extension was already installed, but disabled. I reactivated the extension, didn’t see any errors at that point. But going to the extensions panel, and creating a custom field, I get the same errors as above. If i remember correctly, before disabling the extension I had deleted all custom fields it had created (custom_11 and up) – at least there is nothing left according to Sequel Pro.
I don’t have time to dig deeper atm.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#1160 2017-07-03 09:30:41
Re: glz_custom_fields
phiw13 wrote #306144:
Specified key was too long;
Thanks for the report. I’ve fixed it but haven’t released it as a new version yet.
If you want to patch yours, install it but before activation, find the glz_custom_fields_install() function in the code and change the KEY() in the CREATE TABLE statement to read:
KEY (`name`(50))
Then try enabling/ using the plugin.
If that works I’ll compile up a version and release another beta.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#1161 2017-07-03 10:55:01
- makss
- Plugin Author
- From: Ukraine
- Registered: 2008-10-21
- Posts: 355
Re: glz_custom_fields
Still need to remove the use of the field prefs_id in txp_prefs table.
This line
aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)
Offline
#1162 2017-07-03 11:09:58
Re: glz_custom_fields
makss wrote #306149:
Still need to remove the use of the field
prefs_idintxp_prefstable.
Good catch, thanks. Fixed.
EDIT: Uhh, twice !
Last edited by Bloke (2017-07-04 09:03:05)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#1163 2017-07-03 11:38:06
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: glz_custom_fields
Happy to note that Blocke and makss follow and/or provide maintenance to this essential plugin before its integration into the core! Thank you !!!
Offline
#1164 2017-07-03 12:07:12
Re: glz_custom_fields
Please can you put topic tags of ‘textpattern’ and ‘textpattern-plugin’ on the GitHub repo to aid discoverability. Also maybe turn on the issues tab?
I’ll see if I can improve the HTML structure of this plugin in due course, so it sites better in 4.6/4.7.
Offline
#1165 2017-07-03 12:14:35
Re: glz_custom_fields
Bloke wrote #306148:
Thanks for the report. I’ve fixed it but haven’t released it as a new version yet.
OK, I‘ll give it a test tomorrow morning (it is getting late here)
Meanwhile,I had made some changes to the HTML structure for the plugin to match TXP 4.6+: Download, If you plan to release an update, can as well integrate it.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#1166 2017-07-03 23:20:45
Re: glz_custom_fields
step 1
Installed but not activated, then patch (2 instances, per comment and comment). Save.
Activate.
Navigate to the Write panel (as I need to navigate away from the Plugins panel anyway to allow access to the Extensions menu).
There I’m greeted with a bunch of errors:
User_Error "Unknown column 'custom_11' in 'field list'"
in /Users/XXX/Sites/_txp47/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
User_Error "Table 'txp-47.custom_fields' doesn't exist"
in /Users/XXX/Sites/_txp47/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
the latter repeated multiple times… Full log below.
Out of curiosity, I go to the Extensions panel, try creating a new custom field (text input).
User_Error "Column count doesn't match value count at row 1"
in /Users/XXX/Sites/_txp47/textpattern/lib/txplib_db.php at line 409.
No go…
A couple of thoughts: it is possible that when I uninstalled the plugin before starting this test, I didn’t clean up the DB completely, or is it possible that the plugin’s lifecycle thingie is not working correctly?
Step 2.
OK, because I can. Throw away the whole DB associated with this “site” (it is a throwaway thing that only exists for this kind of testing) and start over. Set up process, etc. Login, install + patch plugin, activate, … Same story as above.
PS – regarding the changes I made to the plugin for layout compatibility with TXP 46+: First mentioned here (that download contains changes to the stylesheet), the diff mentioned in my comment above has some additional fixes (using hu and maybe some more, don’t remember).
Full log of what appears on the Write panel:
User_Error "Unknown column 'custom_11' in 'field list'"
in /Users/XXX/Sites/_txp47/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
textpattern/lib/txplib_db.php:409 trigger_error()
textpattern/lib/txplib_db.php:1076 safe_query()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:290 getRow()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:80 glz_article_custom_fields()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:1042 glz_custom_fields_MySQL()
glz_custom_fields_replace()
textpattern/lib/txplib_misc.php:1948 call_user_func_array()
callback_event()
textpattern/lib/txplib_misc.php:2143 call_user_func_array()
User_Error "Table 'txp-47.custom_fields' doesn't exist"
in /Users/XXX/Sites/_txp47/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
textpattern/lib/txplib_db.php:409 trigger_error()
textpattern/lib/txplib_db.php:1105 safe_query()
textpattern/lib/txplib_db.php:1220 getRows()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:186 getThings()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:72 glz_values_custom_field()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:1053 glz_custom_fields_MySQL()
glz_custom_fields_replace()
textpattern/lib/txplib_misc.php:1948 call_user_func_array()
callback_event()
User_Error "Table 'txp-47.custom_fields' doesn't exist"
in /Users/XXX/Sites/_txp47/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
textpattern/lib/txplib_db.php:409 trigger_error()
textpattern/lib/txplib_db.php:1105 safe_query()
textpattern/lib/txplib_db.php:1220 getRows()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:186 getThings()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:72 glz_values_custom_field()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:1053 glz_custom_fields_MySQL()
glz_custom_fields_replace()
textpattern/lib/txplib_misc.php:1948 call_user_func_array()
callback_event()
User_Error "Table 'txp-47.custom_fields' doesn't exist"
in /Users/XXX/Sites/_txp47/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
textpattern/lib/txplib_db.php:409 trigger_error()
textpattern/lib/txplib_db.php:1105 safe_query()
textpattern/lib/txplib_db.php:1220 getRows()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:186 getThings()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:72 glz_values_custom_field()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:1053 glz_custom_fields_MySQL()
glz_custom_fields_replace()
textpattern/lib/txplib_misc.php:1948 call_user_func_array()
callback_event()
User_Error "Table 'txp-47.custom_fields' doesn't exist"
in /Users/XXX/Sites/_txp47/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
textpattern/lib/txplib_db.php:409 trigger_error()
textpattern/lib/txplib_db.php:1105 safe_query()
textpattern/lib/txplib_db.php:1220 getRows()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:186 getThings()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:72 glz_values_custom_field()
textpattern/lib/txplib_misc.php(1835) : eval()'d code:1053 glz_custom_fields_MySQL()
glz_custom_fields_replace()
textpattern/lib/txplib_misc.php:1948 call_user_func_array()
callback_event()
Last edited by phiw13 (2017-07-03 23:26:19)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#1167 2017-07-04 09:11:39
Re: glz_custom_fields
Ummm, I screwed up the fix. Dropped a quote by accident ? That’ll teach me to commit without testing.
Do things improve if you use a version that doesn’t have syntax errors in the SQL call?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#1168 2017-07-04 09:15:10
Re: glz_custom_fields
Bloke wrote #306174:
Ummm, I screwed up the fix. Dropped a quote by accident ? That’ll teach me to commit without testing.
Do things improve if you use a version that doesn’t have syntax errors in the SQL call?
Nope :-( I had seen makss comment and made sure the quote was there.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#1169 2017-07-04 09:44:09
Re: glz_custom_fields
Dammit, I’ll have to investigate this. Could be a lifecycle issue. I’ll need to set up a test environment, popualte it with CFs and content, then upgrade the plugin and catch the fallout.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#1170 2017-07-23 08:20:32
Re: glz_custom_fields
Just an additional note related to this plugin, when using txp 4.7-dev. I was trying to use “smd_where_used” plugin today. smd_where_used gave me the following error:
User_Error "Unknown column 'custom_11' in 'where clause'"
in /Users/xxxx/Sites/yyyy/textpattern/lib/txplib_db.php at line 409.
Turns out there where still some remnants of those custom_11 (and higher) fields, despite having completely uninstalled the plugin (and checked through the DB…). smd_where_used had at one point indexed the whole thing, and remembered those fields. I found it with the help of SequelPro, in the txp_prefs table, the smd_wu_article_fields field.
(sidenote: does uninstalling a plugin such as smd_where_used clear out the prefs for that plugin from the DB? I tried it and that did not happen on my TXP4.7-dev. IOW, the plugin prefs remained listed in the DB).
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline