Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
# This is a description for the TinyMCE 7 library integration with Moodle.
1 efrain 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.
1441 ariadna 6
The Moodle `main` branch is named as the upcoming STABLE branch name, for example during the development of Moodle 4.5.0, the upcoming STABLE branch name will be MOODLE_405_STABLE.
1 efrain 7
 
8
## Patches included in this release
9
 
1441 ariadna 10
N/A
1 efrain 11
 
12
## Upgrade procedure for TinyMCE Editor
13
 
14
1. Store an environment variable to the Tiny directory in the Moodle repository (the current directory).
15
 
16
 ```
1441 ariadna 17
MOODLEDIR=/your_moodle_dir/lib/editor/tiny
1 efrain 18
 ```
19
 
20
2. Check out a clean copy of TinyMCE of the target version.
21
 
22
 ```
23
tinymce=`mktemp -d`
24
cd "${tinymce}"
25
git clone https://github.com/tinymce/tinymce.git
26
cd tinymce
1441 ariadna 27
git checkout -b MOODLE_405_STABLE
1 efrain 28
git reset --hard [desired version]
29
 ```
30
 
31
3. Install dependencies
32
 
33
 ```
34
yarn
35
 ```
36
 
37
4. Check in the base changes
38
 
39
 ```
40
git commit -m 'MDL: Add build configuration'
41
 ```
42
 
43
5. Apply any necessary security patches.
44
6. Rebuild TinyMCE
45
 
46
 ```
47
yarn
48
yarn build
49
 ```
50
 
1441 ariadna 51
Note: If you encounter a problem during the build, please check your node version.
52
The latest node version that worked for this build was v21.
53
 
1 efrain 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.
1441 ariadna 65
git tag v4.5.0
1 efrain 66
git remote add moodlehq --tags
1441 ariadna 67
git push moodlehq MOODLE_405_STABLE
1 efrain 68
 ```
69
 
1441 ariadna 70
9. Check the (Release notes)[https://www.tiny.cloud/docs/tinymce/7/release-notes/] for any new plugins, premium plugins, menu items, or buttons and add them to classes/manager.php
1 efrain 71
 
72
## Update procedure for included TinyMCE translations
73
 
1441 ariadna 74
1. Visit https://www.tiny.cloud/get-tiny/language-packages/ and download the "TinyMCE 7 All languages" zip file.
1 efrain 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
 
1441 ariadna 105
7. Review the changes to the language strings file carefully. You may need to:
1 efrain 106
 
1441 ariadna 107
    * Edit new strings so they meet [Moodle's guidelines for language strings](https://moodledev.io/general/development/policies/codingstyle#language-strings).
108
    * Revert changes to any Moodle-updated language strings that were fixed for spelling, grammar, and consistency in past releases to meet Moodle's guidelines. For example, from the [`en_fix` issues](https://tracker.moodle.org/issues/?jql=summary%20~%20%22en_fix%22%20order%20by%20createdDate%20desc). Review the `git` history of the language strings file to verify.
109
 
110
8. Commit the changes.
111
 
112
9. If required, the remaining language strings can be fed into AMOS.
113
 
1 efrain 114
---
115
 
116
**Note:** A set of language files are also generated for all supported translations and may be submitted to AMOS if desired.
117
 
118
---
119
 
120
## Security fix procedure for TinyMCE Editor
121
 
122
1. Store an environment variable to the Tiny directory in the Moodle repository (the current directory).
123
 
124
 ```
1441 ariadna 125
MOODLEDIR=/your_moodle_dir/lib/editor/tiny
1 efrain 126
 ```
127
 
128
2. Check out a clean copy of TinyMCE of the target version.
129
 
130
 ```
131
tinymce=`mktemp -d`
132
cd "${tinymce}"
133
git clone https://github.com/tinymce/tinymce.git
134
cd tinymce
135
git remote add moodlehq https://github.com/moodlehq/tinymce
136
git fetch moodlehq
1441 ariadna 137
git checkout -b MOODLE_405_STABLE moodlehq/MOODLE_405_STABLE
1 efrain 138
 ```
139
 
140
3. Apply any necessary security patches.
141
4. Rebuild TinyMCE
142
 
143
 ```
144
yarn
145
yarn build
146
 ```
147
 
1441 ariadna 148
Note: If you encounter a problem during the build, please check your node version.
149
The latest node version that worked for this build was v21.
150
 
1 efrain 151
5. Remove the old TinyMCE configuration and replace it with the newly built version.
152
 
153
 ```
154
rm -rf "${MOODLEDIR}/js"
155
cp -r modules/tinymce/js "${MOODLEDIR}/js"
156
 ```
157
 
158
---
159
 
160
**Note:** You may need to remove some parts of some patches, such as tests, changelog entries, etc. to get the patch to apply.
161
 
162
**Note:** The generated code may be significantly larger than the source patch
163
 
164
---