Strange error after update

Strange error after update

Andreas R. -
Erantzun kopurua: 9
Hi all, i´m on Moodle 4.1.6+ (Build: 20231102)

After the update I have the following error in the administration or code is displayed to me:

@block @block_activity_results Feature: The activity results block doesn't display student scores for unsupported activity In order to be display student scores As a user I need to properly configure the activity results block Background: Given the following "users" exist: | username | firstname | lastname | email | idnumber | | teacher1 | Teacher | 1 | teacher1@example.com | T1 | And the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on Scenario: Try to configure the block to use an activity without grades Given the following "activities" exist: | activity | name | intro | course | section | idnumber | assignsubmission_file_enabled | | assign | Test assignment | Offline text | C1 | 1 | assign1 | 0 | And the following "blocks" exist: | blockname | contextlevel | reference | pagetypepattern | defaultregion | | activity_results | Course | C1 | course-view-* | side-pre | And I am on "Course 1" course homepage And I configure the "Activity results" block And I set the following fields to these values: | config_showbest | 1 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Display full names | And I press "Save changes" When I am on the "Test assignment" "assign activity editing" page And I set the following fields to these values: | id_grade_modgrade_type | None | And I press "Save and return to course" Then I should see "Error: the activity selected uses a grading method that is not supported by this block." in the "Activity results" "block"

Can anyone make sense of this? Does anyone else have this strange problem too? We using theme_boost_union as theme.

Greets Andy
Puntuazioen batez bestekoa: -
Andreas R.(e)ri erantzunda

Re: Strange error after update

Leon Stringer -
Core developers-ren irudia Particularly helpful Moodlers-ren irudia

This looks like it's the contents of a file used for automated testing: blocks/activity_results/tests/behat/addunsupportedactivity.feature. It certainly shouldn't get displayed in any Moodle page.

Can you share a screenshot of where this appears? And can you share the path from the URL where this appears? We don't need the domain name of your site, just the bit after this.

Leon Stringer(e)ri erantzunda

Re: Strange error after update

Andreas R. -
Hey Leon

Before I answer your question, I turned on the debugger, here is the result:

(So, i´m not sure if ftp load all files, i will try it again and come back. The error i can only see in the admin section, not inside a course)


String does not exist. Please check your string definition for defaulthighestgrades/block_activity_results

    line 10764 of /lib/moodlelib.php: call to debugging()
    line 31 of /blocks/activity_results/settings.php: call to lang_string->__construct()
    line 122 of /lib/classes/plugininfo/block.php: call to include()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8877 of /lib/adminlib.php: call to require()
    line 9009 of /lib/adminlib.php: call to admin_get_root()
    line 59 of /admin/settings.php: call to admin_write_settings()

String does not exist. Please check your string definition for defaulthighestgrades_desc/block_activity_results

    line 10764 of /lib/moodlelib.php: call to debugging()
    line 32 of /blocks/activity_results/settings.php: call to lang_string->__construct()
    line 122 of /lib/classes/plugininfo/block.php: call to include()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8877 of /lib/adminlib.php: call to require()
    line 9009 of /lib/adminlib.php: call to admin_get_root()
    line 59 of /admin/settings.php: call to admin_write_settings()

String does not exist. Please check your string definition for defaultlowestgrades/block_activity_results

    line 10764 of /lib/moodlelib.php: call to debugging()
    line 38 of /blocks/activity_results/settings.php: call to lang_string->__construct()
    line 122 of /lib/classes/plugininfo/block.php: call to include()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8877 of /lib/adminlib.php: call to require()
    line 9009 of /lib/adminlib.php: call to admin_get_root()
    line 59 of /admin/settings.php: call to admin_write_settings()

String does not exist. Please check your string definition for defaultlowestgrades_desc/block_activity_results

    line 10764 of /lib/moodlelib.php: call to debugging()
    line 39 of /blocks/activity_results/settings.php: call to lang_string->__construct()
    line 122 of /lib/classes/plugininfo/block.php: call to include()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8877 of /lib/adminlib.php: call to require()
    line 9009 of /lib/adminlib.php: call to admin_get_root()
    line 59 of /admin/settings.php: call to admin_write_settings()

String does not exist. Please check your string definition for defaultshowgroups/block_activity_results

    line 10764 of /lib/moodlelib.php: call to debugging()
    line 46 of /blocks/activity_results/settings.php: call to lang_string->__construct()
    line 122 of /lib/classes/plugininfo/block.php: call to include()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8877 of /lib/adminlib.php: call to require()
    line 9009 of /lib/adminlib.php: call to admin_get_root()
    line 59 of /admin/settings.php: call to admin_write_settings()

String does not exist. Please check your string definition for defaultshowgroups_desc/block_activity_results

    line 10764 of /lib/moodlelib.php: call to debugging()
    line 47 of /blocks/activity_results/settings.php: call to lang_string->__construct()
    line 122 of /lib/classes/plugininfo/block.php: call to include()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8877 of /lib/adminlib.php: call to require()
    line 9009 of /lib/adminlib.php: call to admin_get_root()
    line 59 of /admin/settings.php: call to admin_write_settings()

String does not exist. Please check your string definition for defaultnameoptions/block_activity_results

    line 10764 of /lib/moodlelib.php: call to debugging()
    line 58 of /blocks/activity_results/settings.php: call to lang_string->__construct()
    line 122 of /lib/classes/plugininfo/block.php: call to include()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8877 of /lib/adminlib.php: call to require()
    line 9009 of /lib/adminlib.php: call to admin_get_root()
    line 59 of /admin/settings.php: call to admin_write_settings()

String does not exist. Please check your string definition for defaultnameoptions_desc/block_activity_results

    line 10764 of /lib/moodlelib.php: call to debugging()
    line 59 of /blocks/activity_results/settings.php: call to lang_string->__construct()
    line 122 of /lib/classes/plugininfo/block.php: call to include()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8877 of /lib/adminlib.php: call to require()
    line 9009 of /lib/adminlib.php: call to admin_get_root()
    line 59 of /admin/settings.php: call to admin_write_settings()

String does not exist. Please check your string definition for defaultgradedisplay/block_activity_results

    line 10764 of /lib/moodlelib.php: call to debugging()
    line 70 of /blocks/activity_results/settings.php: call to lang_string->__construct()
    line 122 of /lib/classes/plugininfo/block.php: call to include()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8877 of /lib/adminlib.php: call to require()
    line 9009 of /lib/adminlib.php: call to admin_get_root()
    line 59 of /admin/settings.php: call to admin_write_settings()

String does not exist. Please check your string definition for defaultgradedisplay_desc/block_activity_results

    line 10764 of /lib/moodlelib.php: call to debugging()
    line 71 of /blocks/activity_results/settings.php: call to lang_string->__construct()
    line 122 of /lib/classes/plugininfo/block.php: call to include()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8877 of /lib/adminlib.php: call to require()
    line 9009 of /lib/adminlib.php: call to admin_get_root()
    line 59 of /admin/settings.php: call to admin_write_settings()

String does not exist. Please check your string definition for defaultdecimalplaces/block_activity_results

    line 10764 of /lib/moodlelib.php: call to debugging()
    line 81 of /blocks/activity_results/settings.php: call to lang_string->__construct()
    line 122 of /lib/classes/plugininfo/block.php: call to include()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8877 of /lib/adminlib.php: call to require()
    line 9009 of /lib/adminlib.php: call to admin_get_root()
    line 59 of /admin/settings.php: call to admin_write_settings()

String does not exist. Please check your string definition for defaultdecimalplaces_desc/block_activity_results

    line 10764 of /lib/moodlelib.php: call to debugging()
    line 82 of /blocks/activity_results/settings.php: call to lang_string->__construct()
    line 122 of /lib/classes/plugininfo/block.php: call to include()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8877 of /lib/adminlib.php: call to require()
    line 9009 of /lib/adminlib.php: call to admin_get_root()
    line 59 of /admin/settings.php: call to admin_write_settings()

Zum Hauptinhalt
Änderungen gespeichert
(Weiter)

Fehleranzeige. Die automatische Weiterleitung ist deaktiviert.

Greets Andy
Eranskina moodle_error.jpg
Andreas R.(e)ri erantzunda

Re: Strange error after update

Visvanath Ratnaweera -
Particularly helpful Moodlers-ren irudia Translators-ren irudia
Seems to be having a rough ride: Error update from 3.11 to 4.16. Perhaps the issues were no over?
Visvanath Ratnaweera(e)ri erantzunda

Re: Strange error after update

Andreas R. -
I´m back with good and bad news irribarrea

There errors in the admin sections are gone. I uploaded all the data again via FTP. The bad news, I have a few new debug messages: (And the redirect URL seems to be disabled in the admin area, not by us!)

Fehler: Class 'mod_unilabel\factory' not found

Weitere Informationen über diesen Fehler
Debug-Info:
Error code: generalexceptionmessage
Stack trace:

line 135 of /mod/unilabel/lib.php: Error thrown
line 2482 of /lib/modinfolib.php: call to unilabel_cm_info_view()
line 2510 of /lib/modinfolib.php: call to cm_info->call_mod_function()
line 1724 of /lib/modinfolib.php: call to cm_info->obtain_view_data()
line 1537 of /lib/modinfolib.php: call to cm_info->get_extra_classes()
line 106 of /course/format/classes/output/local/content/section/cmitem.php: call to cm_info->__get()
line 122 of /course/format/classes/output/local/content/section/cmlist.php: call to core_courseformat\output\local\content\section\cmitem->export_for_template()
line 225 of /course/format/classes/output/local/content/section.php: call to core_courseformat\output\local\content\section\cmlist->export_for_template()
line 156 of /course/format/classes/output/local/content/section.php: call to core_courseformat\output\local\content\section->add_cm_data()
line 46 of /course/format/topics/classes/output/courseformat/content/section.php: call to core_courseformat\output\local\content\section->export_for_template()
line 161 of /course/format/classes/output/local/content.php: call to format_topics\output\courseformat\content\section->export_for_template()
line 86 of /course/format/classes/output/local/content.php: call to core_courseformat\output\local\content->export_sections()
line 504 of /lib/outputrenderers.php: call to core_courseformat\output\local\content->export_for_template()
line 108 of /course/format/classes/output/section_renderer.php: call to plugin_renderer_base->render()
line 60 of /course/format/topics/format.php: call to core_courseformat\output\section_renderer->render()
line 284 of /course/view.php: call to require()

@Visvanath
The update was from 4.16.xx to the latest 4.16 version.

Greets Andy
Andreas R.(e)ri erantzunda

Re: Strange error after update

Leon Stringer -
Core developers-ren irudia Particularly helpful Moodlers-ren irudia

Is the file mod/unilabel/classes/factory.php present in your Moodle source code folder? Does it have the expected contents:

<?php

namespace mod_unilabel;

class factory {
Leon Stringer(e)ri erantzunda

Re: Strange error after update

Andreas R. -
Hey Leon

Thx for reading and help. The file is present in \moodle\mod\unilabel\classes\factory.php

Content of this file is from line 1 to 185:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .

/**
* unilabel module
*
* @package mod_unilabel
* @author Andreas Grabs * @copyright 2018 onwards Grabs EDV {@link https://www.grabs-edv.de}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_unilabel;

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/formslib.php');

/**
* Build a moodle form and uses the form elements given by the used content type.
* @package mod_unilabel
* @author Andreas Grabs * @copyright 2018 onwards Grabs EDV {@link https://www.grabs-edv.de}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class edit_content_form extends \moodleform {
/** @var \stdClass $_course */
private $_course;

/**
* Get an options array to use files in the editor.
*
* @param \context $context
* @return array
*/
public static function editor_options($context) {
return array(
'maxfiles' => EDITOR_UNLIMITED_FILES,
'noclean' => true,
'context' => $context,
'subdirs' => true);
}

/**
* Moodle form definition method to define all needed elements.
* It uses the elements needed by the current content type.
*
* @return void
*/
public function definition() {
$mform = $this->_form;
$this->unilabel = $this->_customdata['unilabel'];
$this->unilabeltype = $this->_customdata['unilabeltype'];
$this->cm = $this->_customdata['cm'];
$this->context = \context_module::instance($this->cm->id);
$this->_course = get_course($this->cm->course);

$mform->addElement('hidden', 'cmid');
$mform->setType('cmid', PARAM_INT);

$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);

$mform->addElement('header', 'unilabelcontenthdr', get_string('editcontent', 'mod_unilabel'));

$this->add_intro_editor();
$this->add_plugin_form_elements();

$this->add_action_buttons();

$this->set_data((array) $this->unilabel);
}

/**
* Does the validation of the submitted values.
*
* @param array $data
* @param array $files
* @return array
*/
public function validation($data, $files) {
$errors = parent::validation($data, $files);
$errors = $this->unilabeltype->form_validation($errors, $data, $files);
return $errors;
}

/**
* Add the intro editor as form element.
*
* @return void
*/
private function add_intro_editor() {
$mform = $this->_form;
$mform->addElement('editor',
'introeditor',
get_string('unilabeltext', 'mod_unilabel'),
array('rows' => 10),
self::editor_options($this->context)
);
$mform->setType('introeditor', PARAM_RAW); // No XSS prevention here, users must be trusted.
}

/**
* Set all default data while loading the form.
*
* @param array $defaultvalues
* @return void
*/
public function set_data($defaultvalues) {

$defaultvalues['cmid'] = $this->cm->id;

$plugindefaultvalues = $this->get_plugin_defaultvalues();

$defaultvalues = $defaultvalues + $plugindefaultvalues;

$draftitemid = file_get_submitted_draft_itemid('introeditor');

$defaultvalues['introeditor']['text'] =
file_prepare_draft_area($draftitemid,
$this->context->id,
'mod_unilabel',
'intro',
false,
array('subdirs' => true),
$defaultvalues['intro']);
$defaultvalues['introeditor']['format'] = $defaultvalues['introformat'];
$defaultvalues['introeditor']['itemid'] = $draftitemid;

parent::set_data($defaultvalues);
}

/**
* Add all form elements needed by the current content type.
*
* @return void
*/
private function add_plugin_form_elements() {
$this->unilabeltype->add_form_fragment($this, $this->context);
}

/**
* Get all default values from the current content type.
*
* @return array
*/
private function get_plugin_defaultvalues() {
$data = array();

$data = $this->unilabeltype->get_form_default($data, $this->unilabel);
return $data;
}

/**
* Return the \MoodleQuickForm form so the current content type can use it.
*
* @return \MoodleQuickForm
*/
public function get_mform() {
return $this->_form;
}

/**
* Return the current course.
*
* @return \stdClass
*/
public function get_course() {
return $this->_course;
}
}

Greets Andy
Andreas R.(e)ri erantzunda

Re: Strange error after update

Leon Stringer -
Core developers-ren irudia Particularly helpful Moodlers-ren irudia

The file you've shared is missing the definition class factory {.... It looks like the contents of mod/unilabel/classes/edit_content_form.php – the wrong file entirely. Try re-uploading the Unilabel plugin's source code into folder mod/unilabel.

For larger amounts of information one can attach files to a reply.

Puntuazioen batez bestekoa:Useful (2)
Leon Stringer(e)ri erantzunda

Re: Strange error after update

Andreas R. -
Good Morning

Errors are gone. Thx Leon, so i will investigate is something wrong with our ftp upload.

Greets Andy
Andreas R.(e)ri erantzunda

Re: Strange error after update

Ken Task -
Particularly helpful Moodlers-ren irudia
Pardon intrusion ... 
Wonder if it's not time to investigate another way to update/upgrade via command line and using git versioning of Moodle core code?

Once you get on 'leading edge' with moodle core code updates/fixes come regularly enough to make use of FTP undesireable.

Command line doesn't require one to be a 'rocket sci' person either! irribarrea


'SoS', Ken

Puntuazioen batez bestekoa:Useful (1)