Skip to content

Commit

Permalink
Rename as many as possible "master" occurrences to "main"
Browse files Browse the repository at this point in the history
- All those making reference to the master branch.
- All those, part of a URL (usually git repository) also renamed.

We have kept apart a few corresponding to:
- Other "master" meanings, unrelated with the branches.
- Some old release notes from 2.x versions.
- general/development/tools/mdk.md (not sure what's changed there)
- general/community/plugincontribution/master2main.md, because it
  explains exactly the move from master to main.
  • Loading branch information
stronk7 committed May 1, 2024
1 parent d2e4460 commit 1e00687
Show file tree
Hide file tree
Showing 95 changed files with 310 additions and 310 deletions.
16 changes: 8 additions & 8 deletions docs/apis/_files/upgrade-txt.mdx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!-- markdownlint-disable first-line-heading -->
Each component and subsystem may make use of an `upgrade.txt` file in the top level folder. A section title is used to identify the Moodle version where the change was introduced, and significant changes for that version relating to that component or subsystem are noted.

For example, given an API change is applied for the upcoming Moodle version 4.1 which is still in the **master** branch (4.1dev), the version number on the `upgrade.txt`'s section title will be set to **4.1**.
For example, given an API change is applied for the upcoming Moodle version 4.1 which is still in the **main** branch (4.1dev), the version number on the `upgrade.txt`'s section title will be set to **4.1**.

```txt title="Example 1: Change applied to the master branch"
```txt title="Example 1: Change applied to the main branch"
== 4.1 ==
An API change to empower educators!
```

#### Changes applied to multiple branches

When changes are integrated to multiple branches, for example a stable version and the master branch, then the relevant versions used to describe the change in the `upgrade.txt` file should be the next version to be released _for each branch_. The **master** branch should always use the next major version.
When changes are integrated to multiple branches, for example a stable version and the main branch, then the relevant versions used to describe the change in the `upgrade.txt` file should be the next version to be released _for each branch_. The **main** branch should always use the next major version.

For example, if a change is applied to the **MOODLE_400_STABLE** during the development of Moodle 4.0.2, and the **master** branch during the development of Moodle 4.1, then the relevant versions will be **4.0.2** and **4.1**, respectively. The section title for the **master** branch will be the same as the one in Example 1. The section title for the **MOODLE_400_STABLE** branch will indicate the next upcoming minor version (4.0.2 in this case):
For example, if a change is applied to the **MOODLE_400_STABLE** during the development of Moodle 4.0.2, and the **main** branch during the development of Moodle 4.1, then the relevant versions will be **4.0.2** and **4.1**, respectively. The section title for the **main** branch will be the same as the one in Example 1. The section title for the **MOODLE_400_STABLE** branch will indicate the next upcoming minor version (4.0.2 in this case):

```txt title="Example 2: Patch applied to master and MOODLE_400_STABLE"
```txt title="Example 2: Patch applied to main and MOODLE_400_STABLE"
== 4.0.2 ==
An API change to empower educators!
```
Expand All @@ -23,7 +23,7 @@ An API change to empower educators!

Multiple versions within the section title are **not** allowed. However, developers may note the Moodle versions that the change applies to within the upgrade note text itself.

```txt title="Example 3a: master (4.1dev)"
```txt title="Example 3a: main (4.1dev)"
== 4.1 ==
An API change to empower educators! (This was fixed in 4.1 and 4.0.2)
```
Expand All @@ -43,9 +43,9 @@ An API change to empower educators!
When Moodle is developing two major versions in parallel, for example Moodle 3.11.0, and Moodle 4.0.0, then the
version in the earliest of the major version development branches will be used for both branches.

For example, given we are in a parallel development situation with **MOODLE_311_STABLE** (3.11dev) and **master** (4.0dev), with Moodle 3.11 as the next upcoming major Moodle version. If an API change is applied to **MOODLE_311_STABLE**, the version number on the section title will be **3.11** for both **master** and **MOODLE_400_STABLE** branches.
For example, given we are in a parallel development situation with **MOODLE_311_STABLE** (3.11dev) and **main** (4.0dev), with Moodle 3.11 as the next upcoming major Moodle version. If an API change is applied to **MOODLE_311_STABLE**, the version number on the section title will be **3.11** for both **main** and **MOODLE_400_STABLE** branches.

```txt title="Example 4a: master (4.0dev)"
```txt title="Example 4a: main (4.0dev)"
== 3.11 ==
An API change to empower educators!
```
Expand Down
2 changes: 1 addition & 1 deletion docs/apis/core/customfields/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ New plugin type `customfield` was also added as part of the Custom fields API. A

## How to use custom fields

Component/plugin that uses custom fields must define a **handler class** for each area and a **configuration page**. Handler class must be called `<PLUGINNAME>/customfield/<AREA>_handler` and be placed in autoloaded location `<PLUGINDIR>/classes/customfield/<AREA>_handler.php`. This class must extend **\core_customfield\handler** . Configuration page may be located anywhere. For course custom fields configuration the admin settings page is used [/course/customfield.php](https://github.com/moodle/moodle/blob/master/course/customfield.php). If the area uses `itemid` this page should take `itemid` as a parameter.
Component/plugin that uses custom fields must define a **handler class** for each area and a **configuration page**. Handler class must be called `<PLUGINNAME>/customfield/<AREA>_handler` and be placed in autoloaded location `<PLUGINDIR>/classes/customfield/<AREA>_handler.php`. This class must extend **\core_customfield\handler** . Configuration page may be located anywhere. For course custom fields configuration the admin settings page is used [/course/customfield.php](https://github.com/moodle/moodle/blob/main/course/customfield.php). If the area uses `itemid` this page should take `itemid` as a parameter.

Handler has protected constructor, to get a handler call `create()` method. Some areas may choose to return a singleton here:

Expand Down
2 changes: 1 addition & 1 deletion docs/apis/core/htmlwriter/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Please consider using [templates](../../../guides/templates/index.md) as an alte

:::note

There is no documentation for most of this class. Please read [HTML Writer Class Reference](https://phpdoc.moodledev.io/master/d4/d78/classhtml__writer.html) for further information.
There is no documentation for most of this class. Please read [HTML Writer Class Reference](https://phpdoc.moodledev.io/main/d4/d78/classhtml__writer.html) for further information.

:::

Expand Down
36 changes: 18 additions & 18 deletions docs/apis/core/reportbuilder/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Column instances define the data captured/displayed within a report column typic

#### Creating columns

To create a new column, just create a new instance of [`reportbuilder/classes/local/report/column.php`](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/report/column.php) class with:
To create a new column, just create a new instance of [`reportbuilder/classes/local/report/column.php`](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/report/column.php) class with:

```php
* string $name
Expand Down Expand Up @@ -80,20 +80,20 @@ Filters & columns are entirely separate concepts in the report, and each can be

#### Filter types

- **Text** ([reportbuilder/classes/local/filters/text.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/filters/text.php))
- **Date** ([reportbuilder/classes/local/filters/date.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/filters/date.php))
- **Number** ([reportbuilder/classes/local/filters/number.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/filters/number.php))
- **Boolean Select** ([reportbuilder/classes/local/filters/boolean_select.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/filters/boolean_select.php))
- **Select** ([reportbuilder/classes/local/filters/select.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/filters/select.php))
- **Course selector** ([reportbuilder/classes/local/filters/course_selector.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/filters/course_selector.php))
- **Duration** ([reportbuilder/classes/local/filters/duration.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/filters/duration.php))
- **Tags** ([reportbuilder/classes/local/filters/tags.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/filters/tags.php))
- **Autocomplete** ([reportbuilder/classes/local/filters/autocomplete.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/filters/autocomplete.php))
- **Category** ([reportbuilder/classes/local/filters/category.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/filters/category.php))
- **Text** ([reportbuilder/classes/local/filters/text.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/filters/text.php))
- **Date** ([reportbuilder/classes/local/filters/date.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/filters/date.php))
- **Number** ([reportbuilder/classes/local/filters/number.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/filters/number.php))
- **Boolean Select** ([reportbuilder/classes/local/filters/boolean_select.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/filters/boolean_select.php))
- **Select** ([reportbuilder/classes/local/filters/select.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/filters/select.php))
- **Course selector** ([reportbuilder/classes/local/filters/course_selector.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/filters/course_selector.php))
- **Duration** ([reportbuilder/classes/local/filters/duration.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/filters/duration.php))
- **Tags** ([reportbuilder/classes/local/filters/tags.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/filters/tags.php))
- **Autocomplete** ([reportbuilder/classes/local/filters/autocomplete.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/filters/autocomplete.php))
- **Category** ([reportbuilder/classes/local/filters/category.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/filters/category.php))

#### Creating filters

To create a new filter, just create a new instance of **[reportbuilder/classes/local/report/filter.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/report/filter.php)** class with:
To create a new filter, just create a new instance of **[reportbuilder/classes/local/report/filter.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/report/filter.php)** class with:

```php
* string $filterclass
Expand Down Expand Up @@ -125,7 +125,7 @@ All report elements can be defined within the reports themselves - but entities

#### Create an entity

To create an entity, the new entity class must extend **[reportbuilder/classes/local/entities/base.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/entities/base.php)** class and must include these methods:
To create an entity, the new entity class must extend **[reportbuilder/classes/local/entities/base.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/entities/base.php)** class and must include these methods:

```php
get_default_table_aliases()
Expand All @@ -149,8 +149,8 @@ This is where we **add** the entity columns and filters.

Check out these two entities as an example to start building reports:

- **User entity**: [reportbuilder/classes/local/entities/user.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/entities/user.php)
- **Course entity**: [reportbuilder/classes/local/entities/course.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/local/entities/course.php)
- **User entity**: [reportbuilder/classes/local/entities/user.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/entities/user.php)
- **Course entity**: [reportbuilder/classes/local/entities/course.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/local/entities/course.php)

### Actions

Expand All @@ -174,7 +174,7 @@ System reports are a consistent way of providing reporting data, with paging, fi

#### Create a new system report using entities

To create a new system report just create a new class extending [reportbuilder/classes/system_report.php](https://github.com/moodle/moodle/blob/master/reportbuilder/classes/system_report.php).
To create a new system report just create a new class extending [reportbuilder/classes/system_report.php](https://github.com/moodle/moodle/blob/main/reportbuilder/classes/system_report.php).

The first method that we need is ***initialise()*** :

Expand Down Expand Up @@ -285,5 +285,5 @@ $this->set_initial_sort_column('task_log:starttime', SORT_DESC);

Check out these two system reports as an example:

- **Task logs**: [`admin/classes/reportbuilder/local/systemreports/task_logs.php`](https://github.com/moodle/moodle/blob/master/admin/classes/reportbuilder/local/systemreports/task_logs.php)
- **Config changes**: [`report/configlog/classes/reportbuilder/local/systemreports/config_changes.php`](https://github.com/moodle/moodle/blob/master/report/configlog/classes/reportbuilder/local/systemreports/config_changes.php)
- **Task logs**: [`admin/classes/reportbuilder/local/systemreports/task_logs.php`](https://github.com/moodle/moodle/blob/main/admin/classes/reportbuilder/local/systemreports/task_logs.php)
- **Config changes**: [`report/configlog/classes/reportbuilder/local/systemreports/config_changes.php`](https://github.com/moodle/moodle/blob/main/report/configlog/classes/reportbuilder/local/systemreports/config_changes.php)
2 changes: 1 addition & 1 deletion docs/apis/plugintypes/assign/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ An assignment feedback plugin can do many things including providing feedback to

:::tip

For a good reference implementation, see the [file](https://github.com/moodle/moodle/tree/master/mod/assign/feedback/file) feedback plugin included with core because it uses most of the features of feedback plugins.
For a good reference implementation, see the [file](https://github.com/moodle/moodle/tree/main/mod/assign/feedback/file) feedback plugin included with core because it uses most of the features of feedback plugins.

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/apis/plugintypes/assign/submission.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ An assignment submission plugin is used to display custom form fields to a stude

:::tip

For a good reference implementation, see the [onlinetext](https://github.com/moodle/moodle/tree/master/mod/assign/submission/onlinetext) submission plugin included with core because it uses most of the features of submission plugins.
For a good reference implementation, see the [onlinetext](https://github.com/moodle/moodle/tree/main/mod/assign/submission/onlinetext) submission plugin included with core because it uses most of the features of submission plugins.

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/apis/plugintypes/communication/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ All the necessary code to synchronise the room members should live here.

:::info

For a real plugin example, please look at the [Matrix plugin](https://github.com/moodle/moodle/tree/master/communication/provider/matrix).
For a real plugin example, please look at the [Matrix plugin](https://github.com/moodle/moodle/tree/main/communication/provider/matrix).

:::
6 changes: 3 additions & 3 deletions docs/apis/plugintypes/qtype/newquestiondefaults.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ All the settings save here should match the ones fetched by `get_default_value`

Because this feature works using user preferences, you need to declare that in your privacy provider.

This is boring but necessary. Easiest way to see what to do is to [copy another question type](https://github.com/moodle/moodle/blob/master/question/type/match/classes/privacy/provider.php).
This is boring but necessary. Easiest way to see what to do is to [copy another question type](https://github.com/moodle/moodle/blob/main/question/type/match/classes/privacy/provider.php).

Note, it is necessary for your provider to declare the ones saved by core. (I suppose, ideally, someone would make a helpful base class, or trait, to make it easier to implement this.)

### Automated tests

Always a good idea. You are likely to need:

1. [Unit tests for the privacy provider](https://github.com/moodle/moodle/blob/master/question/type/match/tests/privacy/provider_test.php).
2. Behat test to show that the saved settings are re-used. Many question types have [a `behat/add.feature` file where it is easy to add coverage for this](https://github.com/moodle/moodle/blob/master/question/type/match/tests/behat/add.feature).
1. [Unit tests for the privacy provider](https://github.com/moodle/moodle/blob/main/question/type/match/tests/privacy/provider_test.php).
2. Behat test to show that the saved settings are re-used. Many question types have [a `behat/add.feature` file where it is easy to add coverage for this](https://github.com/moodle/moodle/blob/main/question/type/match/tests/behat/add.feature).

The links in that list go to examples of how these are implemented in `qtype_match`.
4 changes: 2 additions & 2 deletions docs/apis/plugintypes/tiny/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ By using these tags appropriately, Moodle will ensure that TinyMCE is set as the

### Useful steps

A number of useful Behat steps have been defined in [TinyMCE Behat context](https://github.com/moodle/moodle/blob/master/lib/editor/tiny/tests/behat/behat_editor_tiny.php).
A number of useful Behat steps have been defined in [TinyMCE Behat context](https://github.com/moodle/moodle/blob/main/lib/editor/tiny/tests/behat/behat_editor_tiny.php).

:::caution Use generic steps where possible

Expand All @@ -39,7 +39,7 @@ Typically, when interacting with an Editor, you should use the _generic_ step de

#### Generic steps to interact with editors

Most of these steps are defined in the [Behat Forms context](https://github.com/moodle/moodle/blob/master/lib/tests/behat/behat_forms.php) and this documentation should not be treated as a complete list, rather an indication of approaches that you may consider taking.
Most of these steps are defined in the [Behat Forms context](https://github.com/moodle/moodle/blob/main/lib/tests/behat/behat_forms.php) and this documentation should not be treated as a complete list, rather an indication of approaches that you may consider taking.

##### Setting content of a field

Expand Down
2 changes: 1 addition & 1 deletion docs/apis/subsystems/admin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Few things to highlight:

## Individual settings

Let us look at a simple example: [mod/lesson/settings.php](https://github.com/moodle/moodle/blob/master/mod/lesson/settings.php). This is included by admin/settings/plugins.php, which has already created $settings, which is an admin_settingpage that we can add to. The file contains lots of lines that look a bit like:
Let us look at a simple example: [mod/lesson/settings.php](https://github.com/moodle/moodle/blob/main/mod/lesson/settings.php). This is included by admin/settings/plugins.php, which has already created $settings, which is an admin_settingpage that we can add to. The file contains lots of lines that look a bit like:

```php
$settings->add(new admin_setting_configtext('mod_lesson/mediawidth', get_string('mediawidth', 'lesson'),
Expand Down
2 changes: 1 addition & 1 deletion docs/apis/subsystems/analytics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public function processes_user_data();
/**
* SQL JOIN from a sample to users table.
*
* More info in [https://github.com/moodle/moodle/blob/master/analytics/classes/local/analyser/base.php core_analytics\local\analyser\base]::join_sample_user
* More info in [https://github.com/moodle/moodle/blob/main/analytics/classes/local/analyser/base.php core_analytics\local\analyser\base]::join_sample_user
*
* @param string $sampletablealias The alias of the table with a sampleid field that will join with this SQL string
* @return string
Expand Down
2 changes: 1 addition & 1 deletion docs/apis/subsystems/check/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class foobar_result extends \core\check\result {

For a real example see:

https://github.com/moodle/moodle/blob/master/lib/classes/check/access/riskxss_result.php
https://github.com/moodle/moodle/blob/main/lib/classes/check/access/riskxss_result.php

### Asynchronous checks

Expand Down
Loading

0 comments on commit 1e00687

Please sign in to comment.