b2bcodext / cms-form-builder

CMS Form Builder is a flexible OroCommerce extension that allows you to easily create forms via UI
Other
8 stars 4 forks source link

CMS forms index page shows 'no results' when 'b2b_code_cms_form' table does not exist #8

Closed kovalchuk-vyacheslav closed 2 years ago

kovalchuk-vyacheslav commented 3 years ago
Снимок экрана 2021-07-08 в 11 45 29

If for some reason table 'b2b_code_cms_form' was not created during upgrade - CMS forms will still be shown, index page works fine (which is confusing) and the only way to figure our that everything is broken is try to create new CMS form

Снимок экрана 2021-07-08 в 11 48 02

I guess index page should show '500 error' in case if table does not exist.

dnahrebecki commented 3 years ago

Hi @kovalchuk-vyacheslav , if the table doesn't exist, it means the upgrade process has not been executed properly. If the extension is installed, the assumption is that all of the migrations must be executed.

kovalchuk-vyacheslav commented 3 years ago

Well, looks like assumption is wrong in some cases, and the only way to figure it out is by trying to create new CMS form. I guess at least error notification should be shown on index page, if you don't want to show errors there.

kovalchuk-vyacheslav commented 3 years ago

In our concrete case this extension was added in Oro 3.1, then removed during 4.2 upgrade (removed tables, but migration record was left), then we added it using 'composer require', got no errors during installation, no errors during upgrade, no errors on index page, thought that everything is ok, deployed it to production and got error only on step of saving new form to database

dnahrebecki commented 3 years ago

In this case the upgrade process was wrong - if you removed the tables you should have removed the migration record as well.