Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#676 2010-03-22 12:12:02

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,424
Website GitHub

Re: glz_custom_fields

gerhard wrote:

What about introducing a new get_ordered_prefs()?

Could do. Not sure which is the best way to go actually; a dedicated function that allows migration as you suggest, or simply altering the existing get_prefs() like this.

I don’t think it slows things down significantly; get_prefs is called once on the public side and twice on the admin side (three times if you’re on the Diagnostics tab). Do you think a dedicated function is better to maintain current performance?

I do kinda wish the two queries inside txp_prefs could be rolled into one, but the requirement to allow global prefs to override like-named user prefs means this isn’t possible. Ummm, I don’t think. At least, if it can be done I don’t know how to do it.

Hope this isn’t going too OT in your support thread, sorry.

Last edited by Bloke (2010-03-22 12:13:22)


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

#677 2010-03-22 12:44:23

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,424
Website GitHub

Re: glz_custom_fields

On an actual support topic note, in this version 1.2.4 of glz_cf if I alter the order of the custom fields a few things that I consider unexpected1 happen. Say I decide to move custom_11_set to position 1 and custom_12_set to position 2 by setting their Position values to 1 and 2, respectively:

  1. custom_11_set appears in the 2nd custom field slot on the Write tab, after custom_1
  2. custom_12_set appears in the 4th custom field slot on the Write tab, after custom_1, custom_11, and custom_2
  3. I’m unable to delete custom_11 and custom_12 until I renumber them to something > 10
  4. The Position column on the Extensions->Custom Fields tab shows, from top to bottom: 1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10
  5. I’m allowed to delete custom_9 and custom_10 because they’ve “popped out” of the top 10

Bug, feature or user error?

1 Your expectations vs mine may differ :-)


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

#678 2010-03-27 00:35:39

mlarino
Member
Registered: 2007-06-29
Posts: 367

Re: glz_custom_fields

Not sure if this is a bug, but I just noticed a little problem with Checkboxes.

I have a custom field with 28 checkboxes, and I can only check 21 of them.
If I check more than 21, when I hit save in the write tab when it refreshes only 21 are checked, and the ones on the bottom get uncheck.
Wierd… not sure if its a user problem, can someone else test this?

this is the content in my check box custom field:

Acceso para minusválidos
Aire Acondicionado
Alarma
Amueblado
Animales permitidos
Ascensor
Aseos
Balcón
Calefacción
Chimenea
Conserje
Cocina amueblada
Doble ventana
Escaparate
Exterior
Garaje
Hilo musical
Jardín
Parcela cerrada
Piscina
Puerta de seguridad
Riego automático
Porche
Salida de gases
Terraza
Trastero
Video Portero
Vistas

Offline

#679 2010-03-27 00:45:00

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

Re: glz_custom_fields

mlarino wrote:

If I check more than 21, when I hit save in the write tab when it refreshes only 21 are checked, and the ones on the bottom get uncheck.

You’re right.


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

Offline

#680 2010-03-31 16:25:54

datorhaexa
Member
From: Düsseldorf, Germany
Registered: 2005-05-23
Posts: 115
Website

Re: glz_custom_fields

Went through the entire thread but I couldn’t seem to find any information on if there’s a limit to the number of chars in the textarea? Or, is it without a limit?

Offline

#681 2010-04-01 06:23:28

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,675
GitHub Twitter

Re: glz_custom_fields

Hi Gerard ;)

I’m just reporting a bug:

I created 12 custom fields. Then, decided to remove someone. Action on “Delete” buttom was fine except on the 11Th custom field!
Go back to “article” tab, and I saw a PHP error reporting like this “variable for custom_11 not defined in /include/article.php”. Looking throught my data base, and I saw the field “max custom field” in prefs table was set with the number 11.

So it seems that when we remove all custom fields the “max custom field” value isn’t changed into the “prefs” table.

Cheers,

Edit: Oops, don’t read Stef post, sorry. That’s exactly the same problem man.

Last edited by Pat64 (2010-04-01 06:25:29)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#682 2010-04-01 11:54:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,424
Website GitHub

Re: glz_custom_fields

Pat64 wrote:

Oops, don’t read Stef post, sorry. That’s exactly the same problem man.

Since I’ve had no real resistance to my custom fields patch proposal I’ll go ahead and submit it sometime this weekend. That means, from the next TXP version onwards, gerhard no longer needs to rely on the max_custom_fields value and can instead call the native getCustomFields() function to get an array of the actual custom fields in use, contiguous or not. That should put an end to the errors on the admin side and should make custom fields more robust going forwards.


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

#683 2010-04-01 16:35:43

datorhaexa
Member
From: Düsseldorf, Germany
Registered: 2005-05-23
Posts: 115
Website

Re: glz_custom_fields

meep! Could anyone enlighten me on my question about the limit of textfield? I need to know before I decide on how to go about a website.

Offline

#684 2010-04-01 16:50:01

mlarino
Member
Registered: 2007-06-29
Posts: 367

Re: glz_custom_fields

mlarino wrote:

Not sure if this is a bug, but I just noticed a little problem with Checkboxes.

why is this happening? Is it a cf limitation?
Thanks!!

Last edited by mlarino (2010-04-01 16:52:22)

Offline

#685 2010-04-01 17:07:22

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: glz_custom_fields

Bloke wrote: That means, from the next TXP version onwards, gerhard no longer needs to rely on the max_custom_fields value and can instead call the native getCustomFields() function to get an array of the actual custom fields in use, contiguous or not. That should put an end to the errors on the admin side and should make custom fields more robust going forwards.

awesome. big ups! much ‘spect.

Offline

#686 2010-04-02 13:36:50

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: glz_custom_fields

Hi Gerhard,

I’ve got this code cleanly producing a unix timestamp number for a date in a custom field, I end up with the variable I need (numEvent) (props to Els and Stef).

<txp:variable name="kate" value='<txp:custom_field name="Event date" />' />
<txp:variable name="julie" value='<txp:rah_replace from="/" to="-"><txp:variable name="kate" /></txp:rah_replace>' />
<txp:variable name="numEvent" value='<txp:smd_cal_now format="%s" now=''<txp:variable name="julie" />'' />' />

When an article is saved, I would like a custom field to store this numer — in other words, for this code to run to populate the chosen custom field.

I see I can choose a custom field of type ‘Custom Script’ and I have had a look at your my_images.php example, and got lost.

If this is complex, then it’s a big ask for me to ask you (or anyone) to simply do this code for me, but I’m asking just in case it’s very simple (always the optimist! :)

No worries and thanks anyway if you have no time and/or this is complex, and thanks also if you have time to comment, even if it’s only to say what I want to do can’t be done.

Cheers! -Alan


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#687 2010-04-02 14:59:05

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: glz_custom_fields

datorhaexa wrote:

meep! Could anyone enlighten me on my question about the limit of textfield? I need to know before I decide on how to go about a website.

textfield limit is 255 (mysql ‘varchar(255)’ data type)
textarea limit should be 65535 (mysql ‘text’ data type)

Offline

#688 2010-04-05 09:15:01

datorhaexa
Member
From: Düsseldorf, Germany
Registered: 2005-05-23
Posts: 115
Website

Re: glz_custom_fields

Whow! Gigathanks redbot!

Offline

#689 2010-04-07 22:21:20

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 604

Re: glz_custom_fields

After a quick successful experiment with the plugin I’ve started reciving the following error messages.

On the Write page:
Warning: Table ‘custom_fields’ is marked as crashed and should be repaired SELECT `value` FROM `custom_fields` WHERE `name` = ‘custom_1_set’ ORDER BY id ASC in /Users/Ross/Dropbox/Sites/Dev/txp_ts/textpattern/lib/txplib_db.php on line 85

Year Group
Ooops! custom_1 has some problems. Go fix it.

On the plugin extensions page:
Warning: Table ‘custom_fields’ is marked as crashed and should be repaired SELECT `value` FROM `custom_fields` WHERE `name` = ‘custom_1_set’ ORDER BY id ASC in /Users/Ross/Dropbox/Sites/Dev/txp_ts/textpattern/lib/txplib_db.php on line 85

Any suggestions on how to fix this?

Just in case this has any bearing on things, I’m using Dropbox to sync my everything between my iMac and MacBook Pro so I can work on my websites on either computer. I’m using MAMP for the server and have moved the database files out of the MAMP folder (in Applications) and have placed it in my Dropbox folder. In the MAMP folder I have replaced the DB folder with a symbolic link pointing to its location within my Dropbox.

Last edited by Algaris (2010-04-07 22:26:21)

Offline

#690 2010-04-08 02:56:21

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: glz_custom_fields

Hi Ross, I’m not qualified to speak for the author of glz_custom_fields, but as a user of it I have found it to be polished and reliable. So I would guess the problem lies elsewhere.

Also, I think I read somewhere in the MAMP manual or during install, that for MAMP to work reliably, the database files must stay where MAMP puts them at install — I may be wrong, but perhaps worth checking.

I know DropBox allows you to name an alternate place for it’s folder, so that may help you…

And last but not least, I have been told that copying databases by copying the files that represent the data is not ‘safe’ due to file locking and other issues and the reliable way to get data from a database to another (on another computer) is be export/import, using phpMyadmin or similar.

Hope that’s of some help and good luck, cheers, -Alan


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

Board footer

Powered by FluxBB