Collapse Topic: Error Writing to Database

Collapse Topic: Error Writing to Database

by Carlos Kiyan Tsunami -
Number of replies: 20
Picture of Plugin developers

I am running moodle 2.3.1. After installing the "Collapse Topic-topcoll"  I started to change the course format settings to Collapse Topic.  With the first course I did went well, but  when i started with the second and the third I got the message "Error Writing to Database".

After removing the  "Collapse Topic-topcoll" i was able to access to the second and third course with out any problem.

Please, does anybody know how to solve this problem.

Thanks in advance

 

Average of ratings: -
In reply to Carlos Kiyan Tsunami

Re: Collapse Topic: Error Writing to Database

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Carlos,

Please could you post a screen shot of the specific error message so I can figure out what is going wrong.

Additionally, do you have the table 'format_topcoll_settings' (shown without the table fix) in the database?  If so, what are its attributes and contents please?

Also what version of Collapsed Topics have you installed (the '$plugin->release' constant in 'version.php')?

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Collapse Topic: Error Writing to Database

by Carlos Kiyan Tsunami -
Picture of Plugin developers

Hello Gareth,

thanks for your quick reponse

this is the error that I got after changing to the collapse topic format

Yes I have the topcoll settings

the version is 2012071100

thank you so much in advance

In reply to Carlos Kiyan Tsunami

Re: Collapse Topic: Error Writing to Database

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Carlos,

Very odd!  You have the latest version for 2.3+ and the right structure in the database.

I think I need to somehow know more about the error.  Please could you turn on developer level debugging and see if it tells you more - http://docs.moodle.org/23/en/admin/setting/debugging

I see that it is with course id of 9 - is that in one of the rows of 'format_topcoll_settings' ?

I have done a test on my system with multiple courses and have no issues - so I'm perplexed!  Still can work to find out what is wrong.  Is there anything you have changed / adapted from the instructions?  Was it a straight install from defaults?  Has anything in the topcoll/config.php file changed?

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Collapse Topic: Error Writing to Database

by Carlos Kiyan Tsunami -
Picture of Plugin developers

Dear Gareth

i got this:

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 80

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 166

Notice: Trying to get property of non-object in C:\xampp\htdocs\m21\course\format\topcoll\lib.php on line 168

Notice: Trying to get property of non-object in C:\xampp\htdocs\m21\course\format\topcoll\lib.php on line 169

Notice: Trying to get property of non-object in C:\xampp\htdocs\m21\course\format\topcoll\lib.php on line 170

Notice: Trying to get property of non-object in C:\xampp\htdocs\m21\course\format\topcoll\lib.php on line 171

Notice: Trying to get property of non-object in C:\xampp\htdocs\m21\course\format\topcoll\lib.php on line 172

Notice: Trying to get property of non-object in C:\xampp\htdocs\m21\course\format\topcoll\lib.php on line 173

Error writing to database
Debug info: Column 'layoutelement' cannot be null
INSERT INTO mdl_format_topcoll_settings (courseid,layoutelement,layoutstructure,layoutcolumns,tgfgcolour,tgbgcolour,tgbghvrcolour) VALUES(?,?,?,?,?,?,?)
[array (
0 => '9',
1 => NULL,
2 => NULL,
3 => NULL,
4 => NULL,
5 => NULL,
6 => NULL,
)] 
Error code: dmlwriteexception
Stack trace:
  • line 410 of \lib\dml\moodle_database.php: dml_write_exception thrown
  • line 948 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 990 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 175 of \course\format\topcoll\lib.php: call to mysqli_native_moodle_database->insert_record()
  • line 84 of \course\format\topcoll\lib.php: call to get_topcoll_setting()
  • line 2013 of \lib\navigationlib.php: call to callback_topcoll_get_section_name()
  • line 55 of \course\format\topcoll\lib.php: call to global_navigation->load_generic_course_sections()
  • line 1897 of \lib\navigationlib.php: call to callback_topcoll_load_content()
  • line 1251 of \lib\navigationlib.php: call to global_navigation->load_course_sections()
  • line 3039 of \lib\navigationlib.php: call to global_navigation->initialise()
  • line 778 of \lib\pagelib.php: call to navbar->has_items()
  • line 4 of \theme\b_escartfr\layout\general.php: call to moodle_page->has_navbar()
  • line 765 of \lib\outputrenderers.php: call to include()
  • line 712 of \lib\outputrenderers.php: call to core_renderer->render_page_layout()
  • line 225 of \course\view.php: call to core_renderer->header()
In reply to Carlos Kiyan Tsunami

Re: Collapse Topic: Error Writing to Database

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Carlos,

Still very odd, but the debug does indicate that the global configuration defaults in $TCCFG are not being imported - hence the nulls.  Has anything at all happened to the 'config.php' file in the 'topcoll' folder?  If not then at a hunch can you replace the topcoll/lib.php with the attached and see if that makes a difference?

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Collapse Topic: Error Writing to Database

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Or if that lib.php does not work, then this attached version, as although it works for me, I'm trying a couple of hunches.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Collapse Topic: Error Writing to Database

by Carlos Kiyan Tsunami -
Picture of Plugin developers

Dear Gareth

now it is working. what was the problem?

thank you so much!

Carlos

In reply to Carlos Kiyan Tsunami

Re: Collapse Topic: Error Writing to Database

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Carlos,

No worries.  What did you do?  Did you replace lib.php with any I attached - if so which one please? smile

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Collapse Topic: Error Writing to Database

by Carlos Kiyan Tsunami -
Picture of Plugin developers

Dear Gareth

I just replaced the lib.php that you gave me.

thank you so much

Carlos

In reply to Carlos Kiyan Tsunami

Re: Collapse Topic: Error Writing to Database

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Carlos,

Which one please as they are subtly different!

Thanks,

Gareth

In reply to Gareth J Barnard

Re: Collapse Topic: Error Writing to Database

by Carlos Kiyan Tsunami -
Picture of Plugin developers

Dear Gareth.

well, I only tested yesterday with the file that you will find in attach.

Today I tested with the 2 lib.php, the 2 files are working.

In reply to Carlos Kiyan Tsunami

Re: Collapse Topic: Error Writing to Database

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Carlos,

Thank you smile

Gareth

In reply to Gareth J Barnard

Re: Collapse Topic: Error Writing to Database

by Carlos Kiyan Tsunami -
Picture of Plugin developers

Dear Gareth

Im so sorry again =(. I  was testing a third course and i found this

Invalid get_string() identifier: 'currentsection' or component 'format_topcoll'. Perhaps you are missing $string['currentsection'] = ''; in C:\xampp\htdocs\m21/course/format/topcoll/lang/en/format_topcoll.php?

  • line 6592 of \lib\moodlelib.php: call to debugging()
  • line 7216 of \lib\moodlelib.php: call to core_string_manager->get_string()
  • line 123 of \course\format\topcoll\renderer.php: call to get_string()
  • line 213 of \course\format\topcoll\renderer.php: call to format_topcoll_renderer->section_left_content()
  • line 501 of \course\format\topcoll\renderer.php: call to format_topcoll_renderer->section_header()
  • line 150 of \course\format\topcoll\format.php: call to format_topcoll_renderer->print_multiple_section_page()
  • line 274 of \course\view.php: call to require()

I tried with the 2  lib.php and I got the same error =(

Attachment Screen Shot 2012-08-01 at 11.08.43.png
In reply to Carlos Kiyan Tsunami

Re: Collapse Topic: Error Writing to Database

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Carlos,

No problem at all smile - thanks for spotting it - very strange it did not come up in testing!

Please find attached a corrected /course/format/topcoll/lang/en/format_topcoll.php for you to use.  The next release will incorporate it.

Thanks again,

Gareth

In reply to Gareth J Barnard

Re: Collapse Topic: Error Writing to Database

by Carlos Kiyan Tsunami -
Picture of Plugin developers

Dear Gareth

it works, no more bugs =)

thank you so much!!!

In reply to Carlos Kiyan Tsunami

Re: Collapse Topic: Error Writing to Database

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

No worries Carlos, I'd rather know about a bug and have a chance to fix it than not smile

I'll be doing a formal release with all the fixes soon in the plugin's database.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Collapse Topic: Error Writing to Database

by Carlos Kiyan Tsunami -
Picture of Plugin developers

hi again =(

You will kill me

i tried to install the new plugin and i got this message. The moodle version that I have is 2012062501.00 

In reply to Carlos Kiyan Tsunami

Re: Collapse Topic: Error Writing to Database

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Carlos,

You need to upgrade your version of Moodle 2.3.1 to that of a build of the 19th July 2012+.  This is because of a core change to '/course/format/renderer.php' undertaken in MDL-33767.  Full details in the Readme.txt - info at the top and details at the bottom.  The change is out of my control as it is due to an overridden function who's parameters have changed and therefore my code would have debugging errors if not implemented.

Cheers,

Gareth