Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#71 2020-01-09 12:28:14

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 651
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

Been there before, but can’t seem to find it back here:
How can i change the divider between values in a multiple choice custom field?

glz_custom_fields v2 beta displays | but i would like to display commas instead.

Thanx much!

Last edited by jayrope (2020-01-09 12:35:49)


a hole turned upside down is a dome, when there’s also gravity.

Offline

#72 2020-01-09 13:09:15

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,892
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

jayrope wrote #320965:

How can i change the divider between values in a multiple choice custom field?

glz_custom_fields v2 beta displays | but i would like to display commas instead.

There was a reason for that, but I had to look it up again – see this thread. In short, you can’t change it in the plugin, but you can use either rah_replace to search/replace the | to a , or you can use rah_repeat where you can specify the delimiter you want to use when processing the list of items.


TXP Builders – finely-crafted code, design and txp

Offline

#73 2020-01-09 13:28:32

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 651
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

jakob wrote #320966:

There was a reason for that, but I had to look it up again – see this thread. In short, you can’t change it in the plugin, but you can use either rah_replace to search/replace the | to a , or you can use rah_repeat where you can specify the delimiter you want to use when processing the list of items.

Yes! Jakob, Du rockst. Dicken Dank. That was the answer. I did it before, but couldn’t remember on which of the various sites. Now i just hope that all this will be much more unproblematic with TXP 4.8 …

Last edited by jayrope (2020-01-09 13:29:16)


a hole turned upside down is a dome, when there’s also gravity.

Offline

#74 2020-01-09 13:32:55

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,892
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

Glad you found it. The unlimited custom fields is not in txp 4.8 core (but is in development in a separate branch) but txp 4.8 contains a lot more and is worth updating to when it comes out.

I’ll have to investigate the new plugin format where attached files can be included as part of the plugin. That could make sense for a txp-4.8-only version of this plugin to make installing easier.


TXP Builders – finely-crafted code, design and txp

Offline

#75 2020-01-09 13:48:20

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 651
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

jakob wrote #320968:

Glad you found it. The unlimited custom fields is not in txp 4.8 core (but is in development in a separate branch) but txp 4.8 contains a lot more and is worth updating to when it comes out.

So i will just hope, that the current glz_custom_fields v2 beta will STILL work with TXP 4.8 … ui ui ui.


a hole turned upside down is a dome, when there’s also gravity.

Offline

#76 2020-01-09 14:03:48

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 651
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

While we’re at it:
Can anybody see a way to turn single values from multiple entry custom fields into individual search terms?
Just looking for a roadmap there.
Thank you!


a hole turned upside down is a dome, when there’s also gravity.

Offline

#77 2020-01-09 14:14:14

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,892
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

Can you explain what you’re trying to achieve?

Two examples:

1. A list of search links with each selected value:

<txp:rah_repeat value='<txp:custom_field name="your-multi-cf" />' delimiter="|">
    <a href="https://example.com/?q=<txp:rah_repeat_value escape="url" />">
        Search for “<txp:rah_repeat_value />”
    </a>
</txp:rah_repeat>

or 2. a single search term comprised of all chosen values together:

<!-- construct the search term out of the chosen options -->
<txp:variable name="search_term" escape="trim">
<txp:rah_repeat value='<txp:custom_field name="your-multi-cf" />' delimiter="|" break="+" escape="trim">
    <txp:rah_repeat_value />
</txp:rah_repeat>
</txp:variable>
<!-- the search link -->
<a href="https://example.com/?q=<txp:variable name="search_term" escape="url" />">Search for <txp:variable name="search_term" /></a>
jayrope wrote #320971:

Just looking for a roadmap there.

The idea is that this plugin eventually disappears when more flexible custom fields hit the core. Ideally, at that point, you can migrate your glz_custom_fields to the core method and then remove the plugin altogether.

I will endeavour to ensure it keeps working until then to the best of my abilities but I don’t really want to add any functionality that will mean it is still needed after that.


TXP Builders – finely-crafted code, design and txp

Offline

#78 2020-02-25 09:12:18

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 595
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

Hi I’m getting some errors while creating/deleting a field, regardless the type.
Also in a case of creating a textarea type field it is also “clears” all the data from existing textarea fields from all existing articles, but if I delete that field the data “restores” back.

using TXP v4.8.0 beta3 and PHP7.0, on a migrated installation, in localhost.
I’m currently having 55 custom fields and would like to create more.

On creation error:

User_Error “Incorrect datetime value: ’0000-00-00 00:00:00’ for column ‘Expires’ at row 3”
in C:\wamp64\www\example\textpattern\lib\txplib_db.php at line 403.

Visiting the Write tab returns an error:

User_Error “Unknown column ‘custom_56’ in ‘field list’”
in C:\wamp64\www\example\textpattern\lib\txplib_db.php at line 403.

Deleting any custom field other than the core fields (1-10), returns a error:

There was a problem deleting custom field ID# 25
User_Error “Can’t DROP ‘custom_25’; check that column/key exists”

Last edited by THE BLUE DRAGON (2020-02-25 09:14:04)

Offline

#79 2020-02-25 10:42:42

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,640
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

THE BLUE DRAGON wrote #321886:

User_Error “Incorrect datetime value: ’0000-00-00 00:00:00’ for column ‘Expires’ at row 3”

I thought the patched version dealt with the NULLDATETIME issue already. One might have slipped through the net, or your MySQL table definitions may need updating to reflect current Txp practices when dealing with null values. There are topics floating around the forum with NULLDATETIME fixes and avenues of exploration, if that helps.

I’m currently having 55 custom fields and would like to create more… Unknown column ‘custom_56’ in ‘field list’

You’re likely hitting the MySQL column or (more likely) row limit. This is a byproduct of custom fields being stored in the article table and is a key driver for moving them out when we eventually merge unlimited custom fields into core.

I expect most of the issues you face with weird data loss and plugin behaviour is related to this.


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

#80 2020-02-25 16:20:29

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,892
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

Thanks for diving in there Stef. I wouldn’t have known that.

User_Error “Incorrect datetime value: ’0000-00-00 00:00:00’ for column ‘Expires’ at row 3”

The datetime message says it refers to ‘Expires’ which should not be affected by glz_custom_fields at all.

All the same, I haven’t tested glz_custom_fields conclusively against txp 4.8.0 yet, so there may be some tweaks coming.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB