error/Must provide a timesort to and/or from value

error/Must provide a timesort to and/or from value

by Peter Haasdijk -
Number of replies: 10

I have a moodle 3.4 installation online for a client of mine. The students dashboard gives an error: Must provide a timesort to and/or from value. I've googled a lot on this error but could'n figure this one out yet.

The error occurs when I log in as a student, when logging in as admin the error does not occur.

I compared the clients installation with a working, completely new installation locally, but i can see no difference when i look at filedates and filesizes. My  conclusion could be that something in the database is not right?

Does anyone have any idea because this one is really driving me mad and i don't want to go back to the old course overview block. Too easy smile

With regards,

Peter

Average of ratings: -
In reply to Peter Haasdijk

Re: error/Must provide a timesort to and/or from value

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Can you switch Debugging up full and give us the trace that (hopefully) comes with this error. 

It sounds vaguely familiar... but familiar enough, unfortunately.

In reply to Howard Miller

Re: error/Must provide a timesort to and/or from value

by Peter Haasdijk -

Howard,

After purging cache i enabled debugging in developer mode. This results in exactly the same error as mentioned in Brians post.

regards,

Peter

In reply to Peter Haasdijk

Re: error/Must provide a timesort to and/or from value

by Joost Elshoff -
Picture of Particularly helpful Moodlers Picture of Testers

Just going out on a limb here, but have you uninstalled (deleted from server) a block that was previously shown on the dashboard page? I've seen situations where that was the cause. Restoring the previously deleted block or completing the plugin deletion may solve this.


Average of ratings: Useful (2)
In reply to Peter Haasdijk

Re: error/Must provide a timesort to and/or from value

by Brian Carpenter -

I too have this error

This pops up twice. 

Error code: Must provide a timesort to and/or from value
$a contents: 
* line 133 of /calendar/classes/local/api.php: moodle_exception thrown
* line 434 of /calendar/externallib.php: call to core_calendar\local\api::get_action_events_by_timesort()
* line 228 of /lib/externallib.php: call to core_calendar_external::get_calendar_action_events_by_timesort()
* line 59 of /lib/ajax/service.php: call to external_api::call_external_function()

Error code: Must provide a timesort to and/or from value
$a contents: 
* line 133 of /calendar/classes/local/api.php: moodle_exception thrown
* line 434 of /calendar/externallib.php: call to core_calendar\local\api::get_action_events_by_timesort()
* line 228 of /lib/externallib.php: call to core_calendar_external::get_calendar_action_events_by_timesort()
* line 59 of /lib/ajax/service.php: call to external_api::call_external_function()
I have tried to delete the calendar block and upcoming events block from the default dashboard page, but still is happening


Edit:

also this is in the errorlog for apache


[Wed Apr 04 16:08:29.008583 2018] [:error] [pid 2854] [client 164.58.169.16:1929] Default exception handler: Exception - Call to a member function instance_copy() on boolean Debug: \nError code: generalexceptionmessage\n* line 95 of /my/lib.php: Error thrown\n* line 127 of /my/index.php: call to my_copy_page()\n, referer: https://moodle34.wosc.edu/my/indexsys.php


In reply to Brian Carpenter

Re: error/Must provide a timesort to and/or from value

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It's been reported a few times - with no obvious conclusion. 

I would start with the easy things first. Purge your caches. It's worth a try

In reply to Howard Miller

Re: error/Must provide a timesort to and/or from value

by Brian Carpenter -

As per Joost suggestion, I started look around the database for blocks references to deleted blocks.

Found a block that was deleted and uninstalled but for some reason was not removed from mdl_block_instances.


MariaDB [moodle34]> delete from mdl_block_instances where blockname="[bad block here]";


That fixed the problem for me.

In reply to Brian Carpenter

Re: error/Must provide a timesort to and/or from value

by Peter Haasdijk -

Thanks Brian and Joost,

Had my hopes up there for a moment but no, that's not the case. No bad blocks in mdl_block_instances here. This is what the table shows (attached).

Regards,

Peter


Attachment moodle.gif
In reply to Peter Haasdijk

Re: error/Must provide a timesort to and/or from value

by Peter Haasdijk -

Solved

This works for me.

Site administration / Appearance / Default Dashboard page / Blocks editing on
Configure Course overview block: Select pages: Any page matching the above (previously: this specific page).


Regards,

Peter

In reply to Peter Haasdijk

Re: error/Must provide a timesort to and/or from value

by M G -

Hi,

I have created a page and used myoverview block on that page instead of dashboard page. I have kept myoverview block on dashboard as hidden.

Now when I am going to that new page, myoverview is getting loaded properly but I ham getting two popup messages indicating the same error message. 

I have tried this default dashboard setting fix, but it is not working for me. 

Any idea about this?


In reply to M G

Re: error/Must provide a timesort to and/or from value

by M G -

Hi All,

I am still seeing this error on my site. Any suggestions are welcome.