<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=How_to_rebuild_context_paths</id>
	<title>How to rebuild context paths - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=How_to_rebuild_context_paths"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=How_to_rebuild_context_paths&amp;action=history"/>
	<updated>2026-05-07T09:13:13Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=How_to_rebuild_context_paths&amp;diff=1479&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=How_to_rebuild_context_paths&amp;diff=1479&amp;oldid=prev"/>
		<updated>2024-10-14T18:18:10Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 18:18, 14 октября 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Олег Давидович</name></author>
	</entry>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=How_to_rebuild_context_paths&amp;diff=1478&amp;oldid=prev</id>
		<title>1&gt;Jesse.safran в 17:06, 17 октября 2019</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=How_to_rebuild_context_paths&amp;diff=1478&amp;oldid=prev"/>
		<updated>2019-10-17T17:06:31Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
Sometimes, if something has gone wrong in your database, you will get an error like:&lt;br /&gt;
&lt;br /&gt;
 PHP Notice:  Context id 113 does not have valid path, please use context_helper::build_all_paths()&lt;br /&gt;
&lt;br /&gt;
or like:&lt;br /&gt;
&lt;br /&gt;
 Can&amp;#039;t find data record in database table context.&lt;br /&gt;
 Debug info: SELECT * FROM {context} WHERE id = ?[array (0 =&amp;gt; &amp;#039;1030367&amp;#039;,)]&lt;br /&gt;
 Error code: invalidrecord&lt;br /&gt;
&lt;br /&gt;
This page explains how to follow the instruction to &amp;quot;please use context_helper::build_all_paths()&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
== Before you start==&lt;br /&gt;
&lt;br /&gt;
This error should never happen, so the fact that it has may be a symptom of something more serious being wrong. If you are paranoid, you may wish to [[How to check your database for corruption|check your database for corruption]] before running the repair script below.&lt;br /&gt;
&lt;br /&gt;
On the other hand, sometimes these things happen when a course/category delete fails, or is done incorrectly, so you could just run the task as described below to fix the error:&lt;br /&gt;
&lt;br /&gt;
== Step A: Verify the \core\task\context_cleanup_task scheduled task is running, and run it manually, if needed  ==&lt;br /&gt;
&lt;br /&gt;
Go to Site administration -&amp;gt; Server -&amp;gt; Scheduled tasks and look for the Cleanup contexts (\core\task\context_cleanup_task) task.  If it has not run recently, run it via the &amp;quot;Run Now&amp;quot; link, or via the CLI with:&lt;br /&gt;
&lt;br /&gt;
 php admin/tool/task/cli/schedule_task.php --execute=&amp;#039;\core\task\context_cleanup_task&amp;#039; --showdebugging&lt;br /&gt;
&lt;br /&gt;
Once that is done, check if the error has gone away.  If it has, you are done!  If it has not, please move to Step B&lt;br /&gt;
&lt;br /&gt;
== Step B: Edit lib/classes/task/context_cleanup_task.php to fix corrupt context paths ==&lt;br /&gt;
&lt;br /&gt;
In your favorite editor, open lib/classes/task/context_cleanup_task.php and edit the line that reads&lt;br /&gt;
&lt;br /&gt;
 \context_helper::build_all_paths(false); &lt;br /&gt;
&lt;br /&gt;
and change it to&lt;br /&gt;
&lt;br /&gt;
 \context_helper::build_all_paths(true); &lt;br /&gt;
&lt;br /&gt;
to force the task to rebuild the context paths.  Run the \core\task\context_cleanup_task scheduled task again, as you did in Step A.  Your errors should now be gone.  &lt;br /&gt;
&lt;br /&gt;
You can then change &lt;br /&gt;
&lt;br /&gt;
 \context_helper::build_all_paths(true); &lt;br /&gt;
&lt;br /&gt;
back to&lt;br /&gt;
&lt;br /&gt;
 \context_helper::build_all_paths(false); &lt;br /&gt;
&lt;br /&gt;
so the \core\task\context_cleanup_task scheduled task works as intended&lt;/div&gt;</summary>
		<author><name>1&gt;Jesse.safran</name></author>
	</entry>
</feed>