joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[6.0] Note Custom Field Plugin

Open TLWebdesign opened this issue 8 months ago • 10 comments

I've created a Note Custom Field. Based on the Joomla's default Note Form Field Type. This allows users for example to place notes in between custom fields to guide users.

This note only displays in the backend of the website just like the default Note Form Field. It could be made available in front-end if people would desire this.

Summary of Changes

Notes Custom Field added

Testing Instructions

You can discover the extension and then use it in custom fields. It's called note. Discover it, publish the extension. Then go to Article -> Custom Fields. Create a new Field of type "Note"

Check that the note is visisble in the backend article edit page.

Actual result BEFORE applying this Pull Request

No Note Custom Field available.

Expected result AFTER applying this Pull Request

Note Custom Field available.

Link to documentations

Please select:

  • [ ] Documentation link for docs.joomla.org:

  • [x] No documentation changes for docs.joomla.org needed

  • [ ] Pull Request link for manual.joomla.org:

  • [x] No documentation changes for manual.joomla.org needed

TLWebdesign avatar Mar 27 '25 11:03 TLWebdesign

Required and Default Value are not applicable so this will cause confusion. For Show Close Button, I expect the button to not display if set to false.

QuyTon avatar Apr 04 '25 18:04 QuyTon

Required and Default Value are not applicable so this will cause confusion. For Show Close Button, I expect the button to not display if set to false.

Hi,

i'm not exactly sure what you mean with "required". I've removed the empty default value on the close form field xml.

The documentation says this about the close button: close (optional) a value of 'true' (for alerts) or the value for the data-dismiss of the Bootstrap close icon

Wondering if the default should be "true" instead of empty to show the possibility.

TLWebdesign avatar Apr 10 '25 09:04 TLWebdesign

i'm not exactly sure what you mean with "required". I've removed the empty default value on the close form field xml.

45233

The documentation says this about the close button: close (optional) a value of 'true' (for alerts) or the value for the data-dismiss of the Bootstrap close icon

I was expecting it to look like this without the close button.

45233-alert

QuyTon avatar Apr 11 '25 06:04 QuyTon

i'm not exactly sure what you mean with "required". I've removed the empty default value on the close form field xml.

45233

The documentation says this about the close button: close (optional) a value of 'true' (for alerts) or the value for the data-dismiss of the Bootstrap close icon

I was expecting it to look like this without the close button.

45233-alert

Those settings are not added by the plugin. Do you know of a custom field that has these settings removed so i could check that?

TLWebdesign avatar Apr 17 '25 12:04 TLWebdesign

I have tested this item :white_check_mark: successfully on 84c1b7c9b07a61a15f1c42802f9994cc598ed406

Hi Tom, I have successfully tested this.

(1 question, why can't we have this for the User Accounts area as well? :) )


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45233.

exlemor avatar Jun 01 '25 13:06 exlemor

(1 question, why can't we have this for the User Accounts area as well? :) )

Hi Emmanuel,

With User Accounts area do you mean the website front-end? Technically there is no reason why we could not allow this. I've created and tested this already but it's not in the PR because it is not a "plain" implementation of the note form field. If maintainers would want this to also be available in front-end of the website then i could add that.

TLWebdesign avatar Jun 02 '25 13:06 TLWebdesign

(1 question, why can't we have this for the User Accounts area as well? :) )

Hi Emmanuel,

With User Accounts area do you mean the website front-end? Technically there is no reason why we could not allow this. I've created and tested this already but it's not in the PR because it is not a "plain" implementation of the note form field. If maintainers would want this to also be available in front-end of the website then i could add that.

Hi Tom, no I meant backend actually... I know the backend has Users --> User Notes area but that is not referenced in the user's profile itself which is not so convenient, that's why I liked the idea of this being available in the custom fields for Users that would one could have a notes field inside the user's profile... (vs having to go back and forth between a user's profile and the User Notes area).

exlemor avatar Jun 02 '25 17:06 exlemor

@exlemor you are comparing apples and pears

brianteeman avatar Jun 02 '25 18:06 brianteeman

@exlemor like brian said that is totally different from what this is and does. So then the answer is no not with this PR.

TLWebdesign avatar Jun 02 '25 18:06 TLWebdesign

I started testing (and I'm not familar with custom fields). I created a Note custom field with 'notes field description' and 'notes field heading', you see the representation in the screenshots. As mentioned before, some settings like 'Default Value' is unused. 'Automatic Display' is also not used, as there is no content? 'Editable In' works as 'Shown In'. But what hurts me, if I set 'Required' in the custom field, the article is no longer saveable in administrator backend or site frontend, see error message:

screen Backend-View with error

frontend-edit Frontend edit view

Shouldn't we disable the options that can't be used and rename ‘Editable In’ to ‘Display In’? And maybe a use case would be helpful. If this is just a header for the following custom field, couldn't this be ¿easier? implemented with CSS in the following custom field? I would like to continue to support testing, thx.

muhme avatar Jun 06 '25 15:06 muhme

I have tested this item :white_check_mark: successfully on 5a4d7b3475787ea5c77f7d7b96dd016868a74339

I have tested this successfully! Thanks @TLWebdesign

(looking forward to the Front-End version)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45233.

exlemor avatar Aug 11 '25 19:08 exlemor

@exlemor were you able to test thr situation that was mentioned before? Where it is a problem when the field is required and then front-end article is edited?

I have not had the time before my holiday but i will try and get this done and hopefully find some help to fix those issues before beta 1.

TLWebdesign avatar Aug 11 '25 20:08 TLWebdesign

@muhme Thanks for your rigurous testing. you found some issues that need to be fixed for sure. We need to hide unused params indeed. I'm asking around on how i should do that.

The use case is adding extra information in between fields to help end users on how to fill in the forms on the page. I don't think you can achieve what this is doing here with only css. Also it is implementing the same functionality as the standard note field type where this is already possible to do. It was just not possible in custom fields.

I hope to get these issues fixed tonight in time for it to be tested and implemented in J6.0.

TLWebdesign avatar Aug 14 '25 14:08 TLWebdesign

@QuyTon @exlemor @muhme i've removed all unneeded options from the edit view. And i added an option to display the note also in the front-end. Please test it again.

TLWebdesign avatar Aug 14 '25 21:08 TLWebdesign

@TLWebdesign sadly, I found a bug ;(

If you enter in the Note Content field Note 1 Note 2

Note 3 ...

or

<p>Note 1<br>Note 2</p>
<p><br>Note 3<br>...</p>

After saving, you get:

Note 1Note 2 Note 3...

or <p>Note 1Note 2 Note 3...</p>

(I showed that in a video in case that was clearer)

https://github.com/user-attachments/assets/e7265de0-d4a0-4f52-814e-31f14f31806d

exlemor avatar Aug 15 '25 17:08 exlemor

I'm not sure if note content really should be an editor field with fully wysiwyg or if it should be just a simple textarea. My feeling is that it should be the latter. But if you go for editor then you need to add some filtering for security purposes eg filter="\Joomla\CMS\Component\ComponentHelper::filterText"

brianteeman avatar Aug 15 '25 18:08 brianteeman

I have tested this item :white_check_mark: successfully on c29e09a98d8c9a52c34cd6cc0b490dd809104a2b

I have successfully tested this :), thanks @TLWebdesign!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45233.

exlemor avatar Aug 15 '25 20:08 exlemor

I have tested this item :white_check_mark: successfully on c29e09a98d8c9a52c34cd6cc0b490dd809104a2b

Tested with JBT graft full package

  • Enabled 'Log Almost Everything' and 'Debug System'
  • ✅ Created a Note with heading and content, is displayed in backend article editing and is not displayed in Frontend
  • ✅ Created heading-only note
  • ✅ Created content-only note
  • ✅ Created two note fields, shown in backend and if enabled in frontend
  • ✅ No entries in administrator/logs/*, no additional errors in JS console

🤔 Note: if no heading is given the note field title is used in backend, but in frontend it is empty


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45233.

muhme avatar Aug 16 '25 06:08 muhme

Hi @muhme thanks for doing such thorough testing! I aligned the functionality in the front-end the same way as the backend now. So when no title is set it will function exactly like the back-end.

TLWebdesign avatar Aug 16 '25 07:08 TLWebdesign

I have tested this item :white_check_mark: successfully on 413398221d02254c4d6e00799a7bea137bb4bd2f

I have retested this successfully. Thanks @TLWebdesign!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45233.

exlemor avatar Aug 16 '25 11:08 exlemor

I have tested this item :white_check_mark: successfully on 413398221d02254c4d6e00799a7bea137bb4bd2f

I was testing the Note field again, same procedure and it is working with not set Heading on frontend (view/edit) and backend the same way.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45233.

muhme avatar Aug 16 '25 13:08 muhme

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45233.

richard67 avatar Aug 16 '25 16:08 richard67

Back to pending. The update SQL scripts need to be renamed to something newer than 6.0.0-2025-08-02.sql.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45233.

richard67 avatar Aug 16 '25 16:08 richard67

@TLWebdesign Could you rename the update SQL scripts to something newer than "6.0.0-2025-08-02.sql", e.g. "6.0.0-2025-08-16.sql? Thanks in advance.

richard67 avatar Aug 16 '25 16:08 richard67

P.S. If the name of the new update SQL script is not newer than the latest present one when compared with PHP version compare, it will not run when updating e.g. from 6.0.0-alpha3.

richard67 avatar Aug 16 '25 16:08 richard67

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45233.

richard67 avatar Aug 16 '25 17:08 richard67

Thanks @TLWebdesign and thanks @muhme & @exlemor for testing

Bodge-IT avatar Aug 16 '25 17:08 Bodge-IT