block_formal_langs не дает установить с нуля preg - СРОЧНО

Issue #199 closed
Oleg Sychev repo owner created an issue

Originally reported on Google Code with ID 199

Дмитрий, вот какое сообщение я получил.

Можете попробовать поставить копию чистого Moodle 2.4 и воспроизвести ситуацию, посмотреть
в чем проблема? Похоже дело в вашем коде...

Hello,

I have a Moodle site that was originally running Moodle 2.3 with this:
https://oasychev-moodle-plugins.googlecode.com/files/preg-question.zip

I upgraded to Moodle 2.4 and switched to this:
https://oasychev-moodle-plugins.googlecode.com/files/preg_231_release.zip

which worked just fine, and the site is running fine and the regular expression questions
are working fine.

However, creating a new moodle site with Moodle 2.4 and preg_231_release, during the
web-based installation process when it's installing the plugins (right after you confirm
the moodle requirements are met OK), it errors out with this:
---------------------------
Error reading from database

More information about this error <<== links to http://docs.moodle.org/24/en/error/moodle/dmlreadexception

It is usually not possible to recover from errors triggered during installation, you
may need to create a new database or use a different database prefix if you want to
retry the installation.
Debug info: Table 'moodle.mdl_block_formal_langs' doesn't exist
SELECT * FROM mdl_block_formal_langs WHERE visible = ?
[array (
0 => '1',
)]
Error code: dmlreadexception
Stack trace:

    line 426 of /lib/dml/moodle_database.php: dml_read_exception thrown
    line 1023 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
    line 1211 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
    line 1162 of /lib/dml/moodle_database.php: call to moodle_database->get_records_select()
    line 30 of /blocks/formal_langs/block_formal_langs.php: call to moodle_database->get_records()
    line 39 of /question/type/preg/settings.php: call to block_formal_langs::available_langs()
    line 3031 of /lib/pluginlib.php: call to include()
    line 327 of /admin/settings/plugins.php: call to plugininfo_qtype->load_settings()
    line 6264 of /lib/adminlib.php: call to require()
    line 6284 of /lib/adminlib.php: call to admin_get_root()
    line 1445 of /lib/upgradelib.php: call to admin_apply_default_settings()
    line 180 of /admin/index.php: call to install_core()
---------------------------

The problem is the mdl_blocks_formal_langs table isn't created in the database.

I see there's a blocks/formal_langs/db/install.xml file that defines that table that
I guess Moodle is supposed to use to create it.  I compared it to an install.xml from
another plugin and the format looks fine.  I tried changing some things in the XMLDB
PATH at the top, which didn't help:
PATH="blocks/formal_langs/db" rather than PATH="question/type/correctwriting/db" which
certainly didn't look right, and xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
rather than xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd" to match
what another plugin had.

I am stumped.  Do you have any ideas?

Reported by oasychev on 2013-05-30 17:18:34

Comments (4)

  1. Former user Account Deleted
    Обновите версию в официальном релизе. Я уже сталкивался с этим багом, когда ставил 2.5
    с Бирюковой. Баг не в этом. Дело в том, что settings.php во время установки вызывается
    зачем-то до установке и таблица может не обязательно существовать. Этот баг был исправлен
    мной раньше, но ошибке попал в вопрос. Сейчас перенес исправление в блок.
    

    Reported by mamontov.dp on 2013-05-30 17:36:15

  2. Oleg Sychev reporter
    А чего не сливаете мои изменения то? Зачем лишние операции слияния плодить?
    

    Reported by oasychev on 2013-05-31 18:46:02

  3. Oleg Sychev reporter
    Дмитрий, получается что файлы в официальном релизе CorrectWriting тоже надо обновить?
    
    А чего вы молчали?
    

    Reported by oasychev on 2013-05-31 21:00:01

  4. Log in to comment