Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support readonly editors #15157

Merged
merged 6 commits into from
Apr 8, 2017
Merged

Conversation

Bakual
Copy link
Contributor

@Bakual Bakual commented Apr 7, 2017

Pull Request for Issue #13665 .

Summary of Changes

This PR adds support for readonly/disabled editors

Testing Instructions

  • Create a new custom field of the type "editor" and either set the permission so it is not editable (that's the case by default in the contact form) or enabled readonly or disabled in the field options
  • Check the item where the field appears
  • Test with all three core editors (TinyMCE, Codemirror, None)

Another test:

  • Edit the editor formfield spec in a form XML and add a readonly="true" attribute to it. Eg edit /administrator/models/forms/article.xml and change
<field 
	name="articletext"
	type="editor"
	label="COM_CONTENT_FIELD_ARTICLETEXT_LABEL"
	description="COM_CONTENT_FIELD_ARTICLETEXT_DESC"
	filter="JComponentHelper::filterText"
	buttons="true"
/>

to

<field
	name="articletext"
	type="editor"
	label="COM_CONTENT_FIELD_ARTICLETEXT_LABEL"
	description="COM_CONTENT_FIELD_ARTICLETEXT_DESC"
	filter="JComponentHelper::filterText"
	buttons="true"
	readonly="true"
/>
  • Check the item

Expected result

Editor should be readonly/disabled.

Actual result

You can edit the content fine.

Documentation Changes Required

https://docs.joomla.org/Editor_form_field_type can now have added attributes "readonly" and "disabled" (they both do the same thing here).

@brianteeman
Copy link
Contributor

I have tested this item 🔴 unsuccessfully on 7fef75c

with tinymce as the editor I created an editor field for a contact and set it to read only.
I created a new contact and can confirm that the tinymce editor is disabled BUT I then click on the Toggle Editor and can enter text into the editor AND this text will be saved


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

@Bakual
Copy link
Contributor Author

Bakual commented Apr 7, 2017

Good catch, now to figure out where that comes from 😄

@Bakual
Copy link
Contributor Author

Bakual commented Apr 7, 2017

@brianteeman Can you try again? I think I fixed that now.

@zero-24
Copy link
Contributor

zero-24 commented Apr 7, 2017

@Bakual http://213.160.72.75/joomla/joomla-cms/2432 Drone is complaining ;)

@brianteeman
Copy link
Contributor

@Bakual that fixed that bug

@Bakual
Copy link
Contributor Author

Bakual commented Apr 7, 2017

Drone is complaining ;)

@zero-24 Fixed 👍

@brianteeman Thanks for the confirmation.

@ghost
Copy link

ghost commented Apr 8, 2017

I have tested this item ✅ successfully on 58e0ce3


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

@ghost
Copy link

ghost commented Apr 8, 2017

@brianteeman can i alter your Test as successfully?


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

@AlexRed
Copy link
Contributor

AlexRed commented Apr 8, 2017

I have tested this item ✅ successfully on 58e0ce3

Patch ok for me


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

@ghost
Copy link

ghost commented Apr 8, 2017

RTC after two successful tests.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 8, 2017
@brianteeman
Copy link
Contributor

@brianteeman can i alter your Test as successfully?

No - I did not fully test it - I only tested the one small part

@rdeutz rdeutz merged commit a794024 into joomla:staging Apr 8, 2017
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Apr 8, 2017
@rdeutz rdeutz added this to the Joomla 3.7.0 milestone Apr 8, 2017
@Bakual Bakual deleted the SupportReadonlyEditors branch April 8, 2017 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants