-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8117 from 4teamwork/amo/TI-1333/task_template_Wys…
…iwygEditor Change the task template text field to RichtextField
- Loading branch information
Showing
7 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Change task template `text field` from Text field to RichText field. [amo] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
23 changes: 23 additions & 0 deletions
23
...ever/core/upgrades/20250127123059_update_task_template_text_field_to_rich_text/upgrade.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from ftw.upgrade import UpgradeStep | ||
from plone.app.textfield import IRichTextValue | ||
from plone.app.textfield.value import RichTextValue | ||
|
||
|
||
class UpdateTaskTemplateTextFieldToRichText(UpgradeStep): | ||
"""Update task template text field to rich text. | ||
""" | ||
|
||
def __call__(self): | ||
query = {'object_provides': "opengever.tasktemplates.content.tasktemplate.ITaskTemplate"} | ||
msg = "Change task template text field from text field to rich text field" | ||
|
||
for task in self.objects(query, msg): | ||
if IRichTextValue.providedBy(task.text): | ||
continue | ||
|
||
task.text = RichTextValue( | ||
raw=task.text or "", | ||
mimeType='text/html', | ||
outputMimeType='text/x-html-safe', | ||
encoding='utf-8', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters