Skip to main content

Restoring Administration Block in a Course

Screenshot 2023-12-01 at 16-12-13 Moodle in English Admin Block Missing Moodle.org.png

Add &bui_editid=10 to the end of the URL.

The ID for the Admin block seems to be 10 in Live, 70 in Dev.

 

If the block disappears site-wide, check the database for the correct "pagetypepattern" setting.  Anything other than "*" is incorrect.

MariaDB [mdl4]> select * from mdl_block_instances where blockname='settings';
+----+-----------+-----------------+-------------------+-----------------+-----------------+----------------+---------------+---------------+------------------------------------------------------------------+-------------+--------------+
| id | blockname | parentcontextid | showinsubcontexts | requiredbytheme | pagetypepattern | subpagepattern | defaultregion | defaultweight | configdata                                                       | timecreated | timemodified |
+----+-----------+-----------------+-------------------+-----------------+-----------------+----------------+---------------+---------------+------------------------------------------------------------------+-------------+--------------+
| 10 | settings  |               1 |                 1 |               1 | course-view-*   | NULL           | side-pre      |             0 | Tzo4OiJzdGRDbGFzcyI6MTp7czoxMDoiZW5hYmxlZG9jayI7czozOiJ5ZXMiO30= |  1680105855 |   1701718531 |
+----+-----------+-----------------+-------------------+-----------------+-----------------+----------------+---------------+---------------+------------------------------------------------------------------+-------------+--------------+
1 row in set (0.010 sec)

MariaDB [mdl4]> update mdl_block_instances set pagetypepattern='*' where blockname='settings';
Query OK, 1 row affected (0.018 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [mdl4]> select * from mdl_block_instances where blockname='settings';
+----+-----------+-----------------+-------------------+-----------------+-----------------+----------------+---------------+---------------+------------------------------------------------------------------+-------------+--------------+
| id | blockname | parentcontextid | showinsubcontexts | requiredbytheme | pagetypepattern | subpagepattern | defaultregion | defaultweight | configdata                                                       | timecreated | timemodified |
+----+-----------+-----------------+-------------------+-----------------+-----------------+----------------+---------------+---------------+------------------------------------------------------------------+-------------+--------------+
| 10 | settings  |               1 |                 1 |               1 | *               | NULL           | side-pre      |             0 | Tzo4OiJzdGRDbGFzcyI6MTp7czoxMDoiZW5hYmxlZG9jayI7czozOiJ5ZXMiO30= |  1680105855 |   1701720784 |
+----+-----------+-----------------+-------------------+-----------------+-----------------+----------------+---------------+---------------+------------------------------------------------------------------+-------------+--------------+
1 row in set (0.012 sec)