Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1141 2015-10-02 23:50:05
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: glz_custom_fields
The bot_cf_titles plug-in maybe could be something for you, although it is no longer being developed.
Offline
#1142 2015-10-03 14:23:16
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: glz_custom_fields
I did some quick tests with accented letters and umlauts in custom field names: article_custom doesn’t work, as expected (and I don’t expect the article tag to accept those characters, likewise). The (if) custom field tags do work, though. Hence, an amended regex should only be used if done with care, and better than hacking glz_cf is certainly using the plugin GugUser mentioned, bot_cf_title. That one is the right one, not wet_babble. BTW, I tested it and it’s still working. I’ll correct my wet_babble mention above.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#1143 2015-10-03 15:31:16
Re: glz_custom_fields
uli wrote #295362:
better than hacking glz_cf is certainly using the plugin GugUser mentioned, bot_cf_title.
Many thanks to both of you, Uli and GugUser.
I’m glad I asked because it ended up with a viable solution — although it is sometimes tricky to understand each other :)
Offline
#1144 2015-10-03 15:42:21
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: glz_custom_fields
CeBe wrote #295349:
A really big big thank you!
You’re welcome!
It’s been a pleasure to unravel the glz code and and follow variables’ traces up the file, really.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#1145 2015-11-16 16:26:11
- Mekajinn
- Member
- From: UK
- Registered: 2014-04-02
- Posts: 24
Re: glz_custom_fields
Hi there, I’ve spent some time trying to find the answer to my issue, but unfortunately I’m getting nowhere.
I don’t know if this is specific to glz_custom_fields or just Textpattern’s custom field values in general.
Basically I need to be able to populate one of the glz_custom_fields with a single zero from me to time… but it won’t let me. I can have a zero followed by a space, but that inevitably screws up the space I am allowing that field to populate… being a number between zero and six.
Is it just not possible to have a single zero as a custom_field value, or am I just being really stupid? Which is always a possibility!
Thanks for any help anyone can give me in advance.
PS. Other than this really specific issue I think this plugin is brilliant!
Last edited by Mekajinn (2015-11-16 16:26:44)
Offline
#1146 2015-11-16 16:56:32
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: glz_custom_fields
According do my test, it seems that it interprets a zero like empty.
Offline
#1147 2015-11-16 17:00:03
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: glz_custom_fields
Mekajinn wrote #296648:
I don’t know if this is specific to glz_custom_fields or just Textpattern’s custom field values in general.
I’m able to replicate your issue here (save a zero, re-open the article on the Write panel -> empty field). Disabling glz_cf and re-opening the article shows the zero has been saved, though. What’s shown on the public side of your website? Would it be sufficient to know about the problem and have a little faith? Or maybe …
being a number between zero and six.
For the time being, can you try to work around with a pre-defined glz_cf-dropdown menu from 0-6? Maybe that works?
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#1148 2015-11-16 17:05:10
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: glz_custom_fields
Could be that the solution, that an empty field shows zero?
<txp:if_custom_field name="xy"><txp:custom_field name="xy" /><txp:else />0</txp:if_custom_field>
Offline
#1149 2015-11-16 17:13:02
- Mekajinn
- Member
- From: UK
- Registered: 2014-04-02
- Posts: 24
Re: glz_custom_fields
Wow, thanks for the quick response!
I’ve tried the pre-defined dropdown, no go on that I’m afraid. If zero is selected it regards it as a blank.
I will try that snippet GugUser… it’s a bit convoluted, but it looks like it’ll work, thank you.
I’m doing a football site for the upcoming euros, and ultimately a zero has a part to play!
Last edited by Mekajinn (2015-11-16 17:16:32)
Offline
#1150 2016-02-28 12:52:21
- lazlo
- Member
- Registered: 2004-02-24
- Posts: 110
Re: glz_custom_fields
I am wondering if anyone else has this quirk. My Advanced Preferences view of Custom Fields doesn’t match my Extensions view of GLZ Custom Fields, specifically in the labels. For example I have a duplicate name problem in the labels.
Label | [Editable Box] |
EditionNumber | [Depth] |
EditionNumber | [EditionNumber] |
Where does the advanced preferences store the names of the custom fields?
I have tried renaming the Depth box and hitting save but the label won’t change, in both the Advanced Preferences and in the Extensions Tab, is there another way to make the change apart from deleting and replacing? Which table stores this info and is it safe to change it there?
ANSWERED: If you can see the Advanced Preferences Table of Custom Fields with the latest version installed it means your glz_custom_fields folders is not correctly installed in your plug-ins folder. You may have just expanded the compressed glz_custom_fields package in the plugins folder, instead place just the inner glz_custom_fields folder into the plugins folder.
Last edited by lazlo (2016-03-07 10:54:35)
Offline
#1151 2017-02-10 02:56:28
Re: glz_custom_fields
Has anyone managed to get this fully working on TXP 4.6.2 ? Using version 1.4 beta 1 linked to in the first post of this thread.
I can get some type of field to work, e.g. a text field (input type=text
), but trying to inserting a textarea
does all kind of unruly things.
In testing mode – creating two custom fields, type = textfield
One alert for each
User_Error "Incorrect integer value: '' for column 'id' at row 1".
(the custom field is actually saved – maybe?)
Going to the Write panel, creating a new article:- the custom fields I created above are present ( text field, in the side bar).
- Fill Title, Body, and the custom fields, save article, OK.
- On the front end, I can get the custom field to output something; OK
Creating a custom field, type = textarea
2 alerts this time:
User_Error "Incorrect integer value: '' for column 'id' at row 1".
User_Error "BLOB/TEXT column 'custom_13' can't have a default value".
But the field is saved – is it really? (at least it appears in the list)
Going back to the Write panel, on load I get an alert – but my custom textarea is actually instead below the “body” field:
User_Error "Unknown column 'custom_13' in 'field list'".
Now things go wrong…
I try to save my test article again (without any changes), I get again that alert
User_Error "Unknown column 'custom_13' in 'field list'".
And then Texpattern message tells me:
The article was not saved due to an error. Please try again.
~~~~~
In debug mode, things are course a bit more verbose:
On Activating the plugin – or was it on installing?, I’m not sure now:
Error: Specified key was too long; max key length is 1000 bytes
Upon creating a custom field – type = textarea
User_Error "Incorrect integer value: '' for column 'id' at row 1"
in /Users/<username>/Sites/_txp-test/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
textpattern/lib/txplib_db.php:409 trigger_error()
textpattern/lib/txplib_misc.php(1782) : eval()'d code:360 safe_query()
textpattern/lib/txplib_misc.php(1782) : eval()'d code:89 glz_new_custom_field()
textpattern/lib/txplib_misc.php(1782) : eval()'d code:1460 glz_custom_fields_MySQL()
glz_custom_fields()
textpattern/lib/txplib_misc.php:1895 call_user_func_array()
textpattern/index.php:214 callback_event()
User_Error "BLOB/TEXT column 'custom_13’ can't have a default value"
in /Users/<username>/Sites/_txp-test/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
textpattern/lib/txplib_db.php:409 trigger_error()
textpattern/lib/txplib_misc.php(1782) : eval()'d code:360 safe_query()
textpattern/lib/txplib_misc.php(1782) : eval()'d code:89 glz_new_custom_field()
textpattern/lib/txplib_misc.php(1782) : eval()'d code:1464 glz_custom_fields_MySQL()
glz_custom_fields()
textpattern/lib/txplib_misc.php:1895 call_user_func_array()
textpattern/index.php:214 callback_event()
Accessing the Write panel (repeated twice)
Notice "Undefined index: custom_13"
in /Users/<username>/Sites/_txp-test/textpattern/include/txp_article.php at line 1608.
textpattern/include/txp_article.php:1608 adminErrorHandler()
textpattern/include/txp_article.php:1756 article_partial_custom_field()
textpattern/lib/txplib_misc.php:390 article_partial_custom_fields()
textpattern/include/txp_article.php:869 updatePartials()
textpattern/include/txp_article.php:129 article_edit()
textpattern/index.php:222 include()
User_Error "Unknown column 'custom_13' in 'field list'"
in /Users/<username>/Sites/_txp-test/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
textpattern/lib/txplib_db.php:409 trigger_error()
textpattern/lib/txplib_db.php:1082 safe_query()
textpattern/lib/txplib_misc.php(1802) : eval()'d code:291 getRow()
textpattern/lib/txplib_misc.php(1802) : eval()'d code:81 glz_article_custom_fields()
textpattern/lib/txplib_misc.php(1802) : eval()'d code:1041 glz_custom_fields_MySQL()
glz_custom_fields_replace()
textpattern/lib/txplib_misc.php:1915 call_user_func_array()
callback_event()
textpattern/lib/txplib_misc.php:2110 call_user_func_array()
I give up…
When looking at the custom_fields table in the DB, it appears empty ?
Edit: After I quit and relaunched Sequel Pro, then the DB table appears populated with the custom fields. Hmm.
Last edited by phiw13 (2017-02-10 05:07:36)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
#1152 2017-02-10 09:18:54
Re: glz_custom_fields
phiw13 wrote #303930:
Has anyone managed to get this fully working on TXP 4.6.2 ? Using version 1.4 beta 1 linked to in the first post of this thread.
Thanks for the testing report. Looks like the plugin needs some 4.6.0 love to bring it up to modern PHP / Txp version standards. I’ll see if I can fork it and get it limping along for you.
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