Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
# This is a description for the TinyMCE 6 library integration with Moodle.
2
 
3
Please note that we have a clone of the official TinyMCE repository which contains the working build and branch for each release. This ensures build repeatability and gives us the ability to patch stable versions of Moodle for security fixes where relevant.
4
 
5
Each Moodle branch has a similar branch in the https://github.com/moodlehq/tinymce.
6
The Moodle `master` branch is named as the upcoming STABLE branch name, for example during the development of Moodle 4.2.0, the upcoming STABLE branch name will be MOODLE_402_STABLE.
7
 
8
## Patches included in this release
9
 
10
- MDL-78714: Add support for disabling XSS Sanitisation (TINY-9600)
11
 
12
Please note: TinyMCE issue numbers are related to bugs in their private issue
13
tracker. See git history of their repository for relevant information.
14
 
15
## Upgrade procedure for TinyMCE Editor
16
 
17
1. Store an environment variable to the Tiny directory in the Moodle repository (the current directory).
18
 
19
 ```
20
MOODLEDIR=`pwd`/../../
21
 ```
22
 
23
2. Check out a clean copy of TinyMCE of the target version.
24
 
25
 ```
26
tinymce=`mktemp -d`
27
cd "${tinymce}"
28
git clone https://github.com/tinymce/tinymce.git
29
cd tinymce
30
git checkout -b MOODLE_404_STABLE
31
git reset --hard [desired version]
32
 ```
33
 
34
3. Install dependencies
35
 
36
 ```
37
yarn
38
 ```
39
 
40
4. Check in the base changes
41
 
42
 ```
43
git commit -m 'MDL: Add build configuration'
44
 ```
45
 
46
5. Apply any necessary security patches.
47
6. Rebuild TinyMCE
48
 
49
 ```
50
yarn
51
yarn build
52
 ```
53
 
54
7. Remove the old TinyMCE configuration and replace it with the newly built version.
55
 
56
 ```
57
rm -rf "${MOODLEDIR}/js"
58
cp -r modules/tinymce/js "${MOODLEDIR}/js"
59
 ```
60
 
61
8. Push the build to MoodleHQ for future change support
62
 
63
 ```
64
# Tag the next Moodle version.
65
git tag v4.2.0
66
git remote add moodlehq --tags
67
git push moodlehq MOODLE_402_STABLE
68
 ```
69
 
70
9. Check the (Release notes)[https://www.tiny.cloud/docs/tinymce/6/release-notes/] for any new plugins, premium plugins, menu items, or buttons and add them to classes/manager.php
71
 
72
## Update procedure for included TinyMCE translations
73
 
74
1. Visit https://www.tiny.cloud/get-tiny/language-packages/ and download the "TinyMCE 6 All languages" zip file.
75
2. Check the list of languages and confirm that the German translation is still at 100%. If not, then make a note of a language which is.
76
3. Unzip the translation into a new directory:
77
 
78
 ```bash
79
langdir=`mktemp -d`
80
cd "${langdir}"
81
unzip path/to/langs.zip
82
 ```
83
 
84
4. Run the translation tool:
85
 
86
 ```bash
87
node "${MOODLEDIR}/tools/createLangStrings.mjs"
88
 ```
89
 
90
 This will generate a language file for each available Language, as well as a `tinystrings.json`, and a `strings.php` which will be used in the subsequent steps.
91
 
92
5. Copy the `tinystrings.json` file into the Moodle directory
93
 
94
 ```
95
cp tinystrings.json "${MOODLEDIR}/tinystrings.json"
96
 ```
97
 
98
6. Copy the content of the `strings.php` file over the existing tiny strings:
99
 
100
 ```
101
sed -i "/string\['tiny:/d" "${MOODLEDIR}/lang/en/editor_tiny.php"
102
cat strings.php >> "${MOODLEDIR}/lang/en/editor_tiny.php"
103
 ```
104
 
105
7. Commit changes. Note: You may need to review individual language changes which do not meet Moodle's guidelines.
106
8. If required, the remaining language strings can be fed into AMOS.
107
 
108
---
109
 
110
**Note:** A set of language files are also generated for all supported translations and may be submitted to AMOS if desired.
111
 
112
**Note:** You will need to manually check for any Moodle-updated language strings as part of this change (for example any from the en_fixes).
113
 
114
---
115
 
116
## Security fix procedure for TinyMCE Editor
117
 
118
1. Store an environment variable to the Tiny directory in the Moodle repository (the current directory).
119
 
120
 ```
121
MOODLEDIR=`pwd`../../
122
 ```
123
 
124
2. Check out a clean copy of TinyMCE of the target version.
125
 
126
 ```
127
tinymce=`mktemp -d`
128
cd "${tinymce}"
129
git clone https://github.com/tinymce/tinymce.git
130
cd tinymce
131
git remote add moodlehq https://github.com/moodlehq/tinymce
132
git fetch moodlehq
133
git checkout -b MOODLE_402_STABLE moodlehq/MOODLE_402_STABLE
134
 ```
135
 
136
3. Apply any necessary security patches.
137
4. Rebuild TinyMCE
138
 
139
 ```
140
yarn
141
yarn build
142
 ```
143
 
144
5. Remove the old TinyMCE configuration and replace it with the newly built version.
145
 
146
 ```
147
rm -rf "${MOODLEDIR}/js"
148
cp -r modules/tinymce/js "${MOODLEDIR}/js"
149
 ```
150
 
151
---
152
 
153
**Note:** You may need to remove some parts of some patches, such as tests, changelog entries, etc. to get the patch to apply.
154
 
155
**Note:** The generated code may be significantly larger than the source patch
156
 
157
---