Skip to content

Issue #153 Add time modified to search report. - #154

Open
jaypha wants to merge 7 commits into
MOODLE_401_STABLEfrom
153-401-modified-date
Open

jaypha wants to merge 7 commits into
MOODLE_401_STABLEfrom
153-401-modified-date

Conversation

@jaypha

@jaypha jaypha commented Sep 26, 2026

Copy link
Copy Markdown

resolves #153

No bonus points.

@jaypha
jaypha force-pushed the 153-401-modified-date branch 2 times, most recently from 9805b01 to 2d1a055 Compare September 26, 2026 00:47
Comment thread classes/helper.php Resolved
@jaypha
jaypha force-pushed the 153-401-modified-date branch 2 times, most recently from 78bf017 to 5a0d455 Compare October 1, 2026 11:31
Comment thread db_search_report.php Outdated
$url->param('perpage', $formdata->perpage);
}

redirect($url);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

redirect should not be needed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tell the form to use get rather than post

optionally - remove other junk from the url which isn't needed (eg sesskey)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The page has been refactored. It all works, but immediately after submitting the form you do get a page with all the URL param guts exposed.

Comment thread classes/form/date_time_filter_form.php Resolved
Comment thread classes/helper.php Resolved
Comment thread classes/helper.php Resolved
Comment thread lang/en/tool_advancedreplace.php Outdated
$string['field_component'] = 'Component';
$string['field_components'] = 'Components';
$string['field_components_help'] = 'Restrict the search to these components. Separate components with commas. eg core_h5p,mod_hvp,mod_assign';
$string['field_course_id'] = 'ID (course)';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Course ID - or reuse string from core?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pretty sure we can remove this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

but its still in the diff?

Comment thread lang/en/tool_advancedreplace.php Outdated
$string['field_tables'] = 'Tables';
$string['field_tables_help'] = 'Tables and columns to search. Separate multiple tables/columns with a comma. If not specified, search all tables and columns. Example format: <code>user,assign_submission:submission</code>';
$string['field_timeend'] = 'End';
$string['field_timemodified'] = 'Modified';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe also in core?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also still in the diff

Comment thread db_search_report.php
$rownum = 0;

while (($row = fgetcsv($fp, 0, ',', '"', '\\')) !== false) {
$timemodified = $row[$timemodifiedindex];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lets keep this, but the srarch filtering I want was back a step in the original search form and this needs to be passed into the task as custom data, and so the csv will be a subset of dates already

Further filtering the csv by date is also useful so lets keep this

@jaypha
jaypha force-pushed the 153-401-modified-date branch 2 times, most recently from 472d3fb to e3c221a Compare October 14, 2026 02:22
@jaypha
jaypha force-pushed the 153-401-modified-date branch 2 times, most recently from daa9045 to 6c69f2e Compare October 20, 2026 23:15
@jaypha
jaypha force-pushed the 153-401-modified-date branch from 6c69f2e to dda2dac Compare October 20, 2026 23:26
@jaypha

jaypha commented Oct 27, 2026 •

Copy link
Copy Markdown
Author

Support any table with a timemodified, or a lastmodified.
Use a cache.
Add a help to say which tables are included.

Comment thread db_search_report.php
// Clearing the filter is a plain link back to the unfiltered report.
$customdata['clearurl'] = $url;

$form = new results_filter_form($url, $customdata, 'get');

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

See if you can get the sesskey removed.

Read table definitions and form acache to store the names of the fields that store last modified timestamps.
Use this cache during filtering.
Add help icon to explain time modified.

Add unit test.
@jaypha
jaypha force-pushed the 153-401-modified-date branch from 01e1880 to 2364c44 Compare October 29, 2026 03:21
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.

When inferring the course and url for a record also infer a date for when it was made

2 participants