Best way to debug pluginfile errors in editor field of form

Re: Best way to debug pluginfile errors in editor field of form

by Darko Miletić -
Number of replies: 3

Since you have two file areas could it be that in one case you are storing file in the wrong file area? I suggest to check the actual file table and see what you have there. 


There is nothing obviously wrong in your code so the error is something small smile. I would recommend you to pass the code through style checker since there are quite a few stylistic errors.

Given that you already use github writing a travis script could be the easiest way for this.

Average of ratings: Useful (1)
In reply to Darko Miletić

Re: Best way to debug pluginfile errors in editor field of form

by Richard Jones -
Picture of Plugin developers Picture of Testers

Hi Darko

Thank you for the advice.  I will try your suggestions.

Richard

In reply to Richard Jones

Re: Best way to debug pluginfile errors in editor field of form

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Excuse me if I am stating the obvious, but when writing code that stores files it is a very good idea to keep some kind of database query available, e.g. select * from mdl_files order by id desc.  I like to use something like mysql workbench of phpmyadmin to do that. It has helped massively when writing file writing code.

Average of ratings: Useful (2)
In reply to Marcus Green

Re: Best way to debug pluginfile errors in editor field of form

by Richard Jones -
Picture of Plugin developers Picture of Testers

Thanks for the suggestion Marcus.