Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2018-04-21 15:31:34

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

A minor bugfix:

  • Custom fields with a value of “0” would not show (php’s empty() function regards 0 as empty). Now fixed.

TXP Builders – finely-crafted code, design and txp

Offline

#38 2018-04-22 04:21:54

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

Big issue #1: with this build (TXP47-dev, up to date), enable debug in the preferences. Access the Write panel (new, unsaved article). Debug spam (notice) for each custom field present.

Notice "Undefined variable: custom_2"
in /Users/username/Sites/_txp47/textpattern/lib/txplib_misc.php(1826) : eval()'d code at line 1745.
textpattern/lib/txplib_misc.php(1826) : eval()'d code:1745 adminErrorHandler()
textpattern/lib/txplib_misc.php:1945 glz_custom_fields_replace()
textpattern/lib/txplib_misc.php:2145 callback_event()
textpattern/include/txp_article.php:1592 pluggable_ui()
textpattern/lib/txplib_misc.php:373 article_partial_custom_fields()
textpattern/include/txp_article.php:709 updatePartials()
textpattern/include/txp_article.php:124 article_edit()
textpattern/index.php:258 include()

It is a notice, not a real error, so nothing bad happens. This does not happen with an already existing article.

Big issue #2: Head over to the Extensions > custom fields panel. Edit a custom field (for example cf #2), save. The custom field is now at the bottom of the list. IOW, the whole set is reordered. This is more annoying, me thinks.

- – - -

A minor issue I noticed the other day (and reproduced with todays build): insert a custom field, type is radio with two values, e.g. yes/no with ‘no’ as default, checked. Thing works fine.
The minor thing is this: access an article, and toggle the value from the default (N -> Y), then click “reset”. The odd thing, to me, is that both values are unchecked at this point, as if the radio group is now undefined. Save the article and the default is now displayed.

Not sure if that is the plugin code or some something in the ajaxy routines.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#39 2018-04-22 08:21:42

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

phiw13 wrote #311301:

Big issue #1: with this build (TXP47-dev, up to date), enable debug in the preferences. Access the Write panel (new, unsaved article). Debug spam (notice) for each custom field present.

Notice "Undefined variable: custom_2"...

Thanks for the report. Sorry, I introduced that with the last change. It only applies to new articles because those articles do not yet have any existing values. I’ve silenced that error now.

Big issue #2: Head over to the Extensions > custom fields panel. Edit a custom field (for example cf #2), save. The custom field is now at the bottom of the list. IOW, the whole set is reordered. This is more annoying, me thinks.

I’ve not been able to replicate this, either with drag-and-drop sorting or using manual position entries. When using drag-and-drop sort, a new custom field is added at the bottom of the list (position 999) which is intentional. You can then drag it to the required position.
If not using drag-and-drop, a new custom field is added at the same position number as its custom field number (if not specified by the user).
When editing, it should save with the existing position settings.

A minor issue I noticed the other day (and reproduced with todays build): insert a custom field, type is radio with two values, e.g. yes/no with ‘no’ as default, checked. Thing works fine.
The minor thing is this: access an article, and toggle the value from the default (N -> Y), then click “reset”. The odd thing, to me, is that both values are unchecked at this point, as if the radio group is now undefined. Save the article and the default is now displayed.

Thanks again. This is because – up to now – the “reset” button deselected all checked statuses from the radio button. It therefore saves with no radio checked. When you come to reload the article (or async save) the {default} value is checked if no value is already specified.
I’ve now changed the behaviour of the “Reset” button. If no {default} setting is specified, everything is as before: reset deselects all radio buttons. If a {default} has been specified, the “Reset” button will now reset to that {default} state.

I’ve updated all the files accordingly :-)


TXP Builders – finely-crafted code, design and txp

Offline

#40 2018-04-22 09:10:10

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

jakob wrote #311305:

I’ve silenced that error now.

Issue #1 resolved. Now we have a quite write panel again!

I’ve not been able to replicate this, (…)
When editing, it should save with the existing position settings.

So, when changing the order from the list panel things worked OK. The issue was (and still is) editing. But perhaps that is something peculiar to this test install.

I can only reproduce it thus: open the first field (ID=1, sorted as the 1st field) for editing, don’t touch anything, but click Save. The field is sent to the bottom of the list. I think that field existed before I installed GLZ-custom field – v2.

(minor issue) Thanks again. This is because – up to now – the “reset” button deselected all checked statuses from the radio button. It therefore saves with no radio checked. When you come to reload the article (or async save) the {default} value is checked if no value is already specified.
I’ve now changed the behaviour of the “Reset” button. If no {default} setting is specified, everything is as before: reset deselects all radio buttons. If a {default} has been specified, the “Reset” button will now reset to that {default} state.

Looks much better now. Thank you.

NB – a radio-button set without a default value always feels very weird to me.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#41 2018-05-01 20:38:10

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

Re: glz_custom_fields v2 beta for Textpattern v4.7

Julian, I’ve just marked Gerhard’s plugin version as outdated (planning to archive the topic after 4.7 is final) and link from there to this topic here. Now I find you also link back there for 4.6.2. Or do I get your wording wrong, and the link to Gerhard is only for TXPs < 4.6?


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

Offline

#42 2018-05-01 20:47:33

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

Great minds :-) We both had the same idea and … we both edited the first post of the old thread at pretty much exactly the same time. I’d updated with a fresh set of links, clicked publish and your revised version appeared so we must have clicked within a few milliseconds of each other with yours winning. I left it as you had it.

I’ve updated the first post of this thread to point to the correct branch (I’d forgotten that when bloke deleted his repo that the link would be dead, but all the older versions including bloke’s and gerhard’s are in the legacy branch of my repo).


TXP Builders – finely-crafted code, design and txp

Offline

#43 2018-05-27 20:25:26

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

Re: glz_custom_fields v2 beta for Textpattern v4.7

Can’t change order of custom fields.

I cannot unpack your plugins zip file, it seems there is a loop in it. Instead i downloaded those files one by one, and they resolve well in Custom fields preferences. However, i still can not change the order of custom fields. The version before had the option to order manually, which was nice. I am running 60++ custom fields in a culture database site. Especically in the backend it’s important to be able to rearrange custom fields as desired, because the range of data input constantly expands…


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

Offline

#44 2018-05-27 22:10:32

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

I cannot unpack your plugins zip file, it seems there is a loop in it. Instead i downloaded those files one by one, and they resolve well in Custom fields preferences

Hmm, I’m really not sure what that’s down to. If I click the download link on Github (direct link) or the “View raw” link I get a zip file downloaded that instantly unpacks into a folder. I tried especially to clean it before uploading to avoid it being riddled with mac-specific hidden files on windows machines.

However, i still can not change the order of custom fields.

I’m not sure about this either. Does your browser inspector give you any hints of files it can’t find or load, or javascript errors with the code? or perhaps a conflict with something else?

The version before had the option to order manually, which was nice. I am running 60++ custom fields in a culture database site.

Here, I can at least help. You’ll need to go into phpMyadmin / sequel pro or another sql editor … or smd_prefalizer. Look in the table txp_pref for the entry glz_cf_use_sortable and change the value of the type column from 2 (hidden) to 1. Now reload the preferences and you’ll have a yes-no switch to use sortable or enter the position value manually.


TXP Builders – finely-crafted code, design and txp

Offline

#45 2018-05-27 23:44:08

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

Re: glz_custom_fields v2 beta for Textpattern v4.7

Jakob, Extensions-> Custom fields gives me those errors in Console:

SyntaxError: expected expression, got ‘<’[Learn More] glz_jqueryui.sortable.min.js:7

jQuery.Deferred exception: $(…).addClass(…).find(…).prepend(…).appendTo(…).sortElements is not a function https://site.com/textpattern/index.php?event=glz_custom_fields&step=get_js:7:5 lhttps://site.com/textpattern/vendors/jquery/jquery/jquery.js:2:29373
a/</c<@https://site.com/textpattern/vendors/jquery/jquery/jquery.js:2:29677 undefined
jquery.js:2:30920

TypeError: $(…).addClass(…).find(…).prepend(…).appendTo(…).sortElements is not a function[Learn More]
index.php:7:5

Great about the sort order solution, i’ll deal with taht in PHPMyAdmin then


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

Offline

#46 2018-05-28 06:56:27

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

@ Jayrope

Weird – are you sure you have a site.com/plugins/glz_custom_fields/glz_jqueryui.sortable.min.js file in your plugin folder?

Which browser / OS BTW?

PS – if you’re on macOS and (some) zipped files give you a problem, try The Unarchiver.app


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#47 2018-05-28 14:54:23

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

Re: glz_custom_fields v2 beta for Textpattern v4.7

phiw13, yes site.com/plugins/glz_custom_fields/glz_jqueryui.sortable.min.js is there. I am on the newest Firefox 60, Mac OSX 10.9.5 – it doesn’t work either in Chrome 62.
Permissions on plugins folder are 755.

I am supposed to be able to drag an drop custom fields to the order i desire, no?
No drag and drop works.

Last edited by jayrope (2018-05-28 14:56:18)


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

Offline

#48 2018-05-28 15:09:12

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

The line numbers of the minified javascript files don’t help much. What might help to identify where the problem is happening is:

  • Make sure you also have the non-minified files in your plugins directory
  • Edit the plugin code: $use_minified = true; to $use_minified = false; (it’s almost at the very end of the plugin code).

Then let us know where the errors are occurring (as you posted above). That should (I hope) give us a useful line number to look at).


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB