Skip to content

Implement Process error table #136

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

Merged
merged 6 commits into from
Jan 27, 2022

Conversation

justusdieckmann
Copy link
Contributor

Screenshot from 2021-12-07 02-05-37

@justusdieckmann justusdieckmann force-pushed the feature/admin-error-page branch from 667488d to 280fd40 Compare December 7, 2021 01:17
@justusdieckmann justusdieckmann force-pushed the feature/admin-error-page branch from 280fd40 to 8054270 Compare December 7, 2021 23:17
Copy link
Contributor

@Laur0r Laur0r left a comment

Choose a reason for hiding this comment

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

Thank you! As an addition, it would be great to have notifications for administrators whenever courses/processes fail or a weekly notification in case processes have failed. If you feel adventurous, you make it a setting :D

echo $this->get_dynamic_table_html_start();

// Render button to allow user to reset table preferences.
echo $this->render_reset_button();
Copy link
Contributor

Choose a reason for hiding this comment

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

We have already asked Aaron about this. Do we really need these buttons for an empty table? We have seen that in multiple plugins but why is it necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really know, I just copied the print_nothing_to_display() function and edited the string

Copy link
Contributor

Choose a reason for hiding this comment

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

Wird schon seine Gründe haben

db/install.xml Outdated
<FIELD NAME="errormessage" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="Message of the error"/>
<FIELD NAME="errortrace" TYPE="text" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="errorhash" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="Where the error occured in the form 'path/to/filename.php:line'"/>
<FIELD NAME="errortime" TYPE="int" LENGTH="11" NOTNULL="true" SEQUENCE="false" COMMENT="unix timestamp - time the error occured"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be more intuitive to use the Moodle standard naming conventions (timecreated instead of errortime).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My reasoning was, that timecreated might be ambigous in this context, since this table copies all fields from the process table, it could mean time the process was created. To make things clear I prefixed all new fields with error. Do you think that justifies the diversion?

Copy link
Contributor

Choose a reason for hiding this comment

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

We see your point however errortime might also be ambiguous, how about errortimecreated?

db/upgrade.php Outdated
$table->add_field('errormessage', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null);
$table->add_field('errortrace', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null);
$table->add_field('errorhash', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
$table->add_field('errortime', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null);
Copy link
Contributor

Choose a reason for hiding this comment

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

see above

Copy link
Contributor

@Laur0r Laur0r left a comment

Choose a reason for hiding this comment

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

Looks close to perfect. However, please add a php-unit test case which checks whether courses are inserted into the error table.

@Laur0r
Copy link
Contributor

Laur0r commented Jan 27, 2022

Generally for best practices, we should write more tests. But it all looks good, thanks!

@Laur0r Laur0r merged commit 9dbce83 into learnweb:master Jan 27, 2022
@justusdieckmann justusdieckmann deleted the feature/admin-error-page branch May 8, 2024 21:17
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.

2 participants