Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #94: Added ability for a datasource to have a null cache key, voiding the caching of the content. #95

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

jaypha
Copy link
Contributor

@jaypha jaypha commented Oct 3, 2023

Resolves #94

Several methods have been deprecated.

  • base::get_content_hash
  • base::update_config_hash

@@ -117,7 +122,7 @@ public function test_config_delete() {
global $DB;

$manager = new manage_content_types();
$cmstype = $manager->create((object) ['name' => 'Name', 'idnumber' => 'test-name']);
$cmstype = $manager->create((object) ['name' => 'Name', 'idnumber' => 'test-name', 'datasources' => 'list']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep it consistent with the class and outward facing name, shouldn't this be userlist instead of list?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we're just going to leave this for now?

tests/renderer_test.php Outdated Show resolved Hide resolved
Copy link
Contributor

@marcusboon marcusboon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to update the cachedefs as well, unit tests are failing

2) core_cache\administration_helper_test::test_get_summaries
Unexpected debugging() call detected.
Debugging: String does not exist. Please check your string definition for cachedef_cms_content_images/mod_cms
* line 10779 of /lib/moodlelib.php: call to debugging()
* line 638 of /cache/classes/definition.php: call to lang_string->__construct()
* line 205 of /cache/classes/administration_helper.php: call to cache_definition->get_name()
* line 100 of /cache/tests/administration_helper_test.php: call to core_cache\administration_helper::get_definition_summaries()
* line 1548 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to core_cache\administration_helper_test->test_get_summaries()
* line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 80 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 728 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 904 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 653 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 144 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 97 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 98 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
Debugging: String does not exist. Please check your string definition for cachedef_cms_content_fields/mod_cms
* line 10779 of /lib/moodlelib.php: call to debugging()
* line 638 of /cache/classes/definition.php: call to lang_string->__construct()
* line 205 of /cache/classes/administration_helper.php: call to cache_definition->get_name()
* line 100 of /cache/tests/administration_helper_test.php: call to core_cache\administration_helper::get_definition_summaries()
* line 1548 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to core_cache\administration_helper_test->test_get_summaries()
* line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 80 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 728 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 904 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 653 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 144 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 97 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 98 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
Debugging: String does not exist. Please check your string definition for cachedef_cms_content_roles/mod_cms
* line 10779 of /lib/moodlelib.php: call to debugging()
* line 638 of /cache/classes/definition.php: call to lang_string->__construct()
* line 205 of /cache/classes/administration_helper.php: call to cache_definition->get_name()
* line 100 of /cache/tests/administration_helper_test.php: call to core_cache\administration_helper::get_definition_summaries()
* line 1548 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to core_cache\administration_helper_test->test_get_summaries()
* line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 80 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 728 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 904 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 653 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 144 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 97 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 98 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
Debugging: String does not exist. Please check your string definition for cachedef_cms_content_userlist/mod_cms
* line 10779 of /lib/moodlelib.php: call to debugging()
* line 638 of /cache/classes/definition.php: call to lang_string->__construct()
* line 205 of /cache/classes/administration_helper.php: call to cache_definition->get_name()
* line 100 of /cache/tests/administration_helper_test.php: call to core_cache\administration_helper::get_definition_summaries()
* line 1548 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to core_cache\administration_helper_test->test_get_summaries()
* line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 80 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 728 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 904 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 653 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 144 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 97 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 98 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()


/var/www/site/lib/phpunit/classes/advanced_testcase.php:88

…oiding the caching of the content.

Several methods have been deprecated.
- base::get_content_hash
- base::update_config_hash
Copy link
Contributor

@marcusboon marcusboon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marcusboon marcusboon merged commit f17c02b into main Oct 5, 2023
18 checks passed
@marcusboon marcusboon deleted the 94-optional-cache branch October 5, 2023 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to selectively disable caching for specific cms_types
2 participants