Commit 8640ccb4 authored by Jérome Perrin's avatar Jérome Perrin

web: depend on erp5_crm

"contact us" feature of erp5_web uses erp5_crm

testTemplateTool depend on the actual order of installation of business
template, so update it now that the order has changed.

configurator scripts also had to be updated, so that
erp5_ingestion_mysql_innodb_catalog is installed before erp5_web/erp5_crm
because since erp5_crm depends on ingestion, it will install
erp5_ingestion_mysql_innodb_catalog, which has new tables and SQL methods
for indexation, so it needs to be installed with `update_catalog=True`.

As we can see here, configurator uses installBusinessTemplateListFromRepository
to install business templates one by one (in the same order that they are
added with addConfigurationItem), and pass update_catalog only for
business templates which add new tables/indexation methods and needs a
catalog update after install, but what happened is that we install
erp5_web with update_catalog=False, which will install
erp5_ingestion_mysql_innodb_catalog, also with update_catalog=False so
the activities to install business templates fail with errors like:

    ProgrammingError: (1146, "Table 'erp5_test_*.email' doesn't exist")
parent d2ba9601
......@@ -4,9 +4,9 @@ bt5_installation_list = ('erp5_simulation',
'erp5_dhtml_style',
'erp5_jquery',
'erp5_jquery_ui',
'erp5_web',
'erp5_ingestion_mysql_innodb_catalog',
'erp5_ingestion',
'erp5_web',
'erp5_dms',
'erp5_crm',
'erp5_pdm',
......
configuration_save = context.restrictedTraverse(configuration_save_url)
bt5_installation_list = ('erp5_jquery',
'erp5_web',
'erp5_ingestion_mysql_innodb_catalog',
'erp5_ingestion',
'erp5_web',
'erp5_ui_test_core',
'erp5_dms',
'erp5_jquery_ui',
......@@ -12,7 +12,7 @@ bt5_installation_list = ('erp5_jquery',
'erp5_run_my_doc',
'erp5_run_my_doc_role')
bt5_update_catalog = ('erp5_ingestion_mysql_innodb_catalog')
bt5_update_catalog = ('erp5_ingestion_mysql_innodb_catalog',)
for name in bt5_installation_list:
configuration_save.addConfigurationItem("Standard BT5 Configurator Item",
......
......@@ -755,10 +755,9 @@ class TestTemplateTool(ERP5TypeTestCase):
ordered_list = template_tool.sortBusinessTemplateList(new_bt5_list)
# group orders
first_group = range(0, 5)
second_group = range(5, 11)
third_group = range(11, 12)
fourth_group = range(12, 14)
fifth_group = range(14, 15)
second_group = range(5, 12)
third_group = range(12, 14)
fourth_group = range(14, 15)
expected_position_dict = {
'erp5_property_sheets': first_group,
......@@ -772,10 +771,10 @@ class TestTemplateTool(ERP5TypeTestCase):
'erp5_ingestion_mysql_innodb_catalog': second_group,
'erp5_base': second_group,
'erp5_knowledge_pad': second_group,
'erp5_ingestion': third_group,
'erp5_web': fourth_group,
'erp5_crm': fourth_group,
'erp5_credential': fifth_group}
'erp5_ingestion': second_group,
'erp5_web': third_group,
'erp5_crm': third_group,
'erp5_credential': fourth_group}
for bt in ordered_list:
self.assertTrue(ordered_list.index(bt) in expected_position_dict[bt[1]],
......
erp5_core (>= 5.4.3)
erp5_xhtml_style
erp5_base
erp5_crm
erp5_jquery
erp5_knowledge_pad
\ No newline at end of file
  • @romain did you know about this usage in StandardBT5ConfiguratorItem ? upgrader uses èTemplateTool.upgradeSite` which takes a list of business templates and install them in one transaction, where configurator uses another template tool API to install business templates one by one, with activities.

    I think this might be a reason why configurator is slow, but the main problem is that we have two APIs and the approach of configurator ( install all business templates with upgradeSite, then fix catalog with upgradeSchema ) is much more robust and we don't have to think about "update catalog" because it's done automatically.

    I'm thinking we should one day change configurator to install business templates with the same way as upgrader, using a new configuration item that will have the list of business templates (instead of X configuration items having each one business template)

  • and the "main problem" is that we should not have to deal with order of business templates or with this update catalog flag, we now have API which takes care of this, so I believe should make configurator use the proper APIs and this would simplify this

  • I don't believe I ever checked how the configurator/upgrader installed the bt5.

    But I'm not surprised that both use 2 different ways. You can also add 2 differents ways from

    • unit tests
    • erp5 UI

    I also believe this should be unified. I tried to do this which Ayush some years ago, but the work was interrupted by other tasks.

  • I was about to say that we could drop maybe drop the "erp5 UI" (this part is really complex, with the interactivity to install/update only some parts), but thinking more, it's at least needed to update upgrader business template.

    Anyway, for now, let's merge this, it will improve a bit editing the default web pages and start coding style on erp5_web.

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment