oda-hub / mmoda-frontend-module

GNU General Public License v2.0
0 stars 1 forks source link

Catalog contains no sources #233

Open volodymyrss opened 4 months ago

volodymyrss commented 4 months ago

https://www.astro.unige.ch/mmoda/node/383/submission/147

reported by @jywoo0116

volodymyrss commented 4 months ago

I confirm that this is the case. Nothing was apparently upgraded on frontend, but this functionality stopped working. There are some errors in JS. Could you check @burnout87 , @motame ?

burnout87 commented 4 months ago

https://www.astro.unige.ch/mmoda/node/383/submission/147

the link does not work, how can I reproduce it? just any request ?

volodymyrss commented 4 months ago

https://www.astro.unige.ch/mmoda/node/383/submission/147

the link does not work,

why? probably some permissions missing? What is needed to view this submission, @motame ?

how can I reproduce it? just any request ?

Yes. Try with the default.

burnout87 commented 4 months ago

https://www.astro.unige.ch/mmoda/node/383/submission/147

the link does not work,

why? probably some permissions missing? What is needed to view this submission, @motame ?

ok iI can see it now, just rushed in replying

burnout87 commented 4 months ago

I did some testing locally as well as on the production. It's weird but it works properly locally.

The Drupal.settings.mmoda object is properly built and read at the latest version, whereas this doesn't happen on the production.

So I suspect that that object (built on the backend side, PHP, to hold some configuration and settings, and read on the frontend side, javascript) is built with n older approach but read with a newer one, causing the issue.

Did the way the Drupal.settings.mmoda object is built on the backend change @motame ?

motame commented 4 months ago

I confirm that it's working properly on dev instance. @burnout87, no, it did not change since the feature "enable use catalog" has been implemented.

burnout87 commented 4 months ago

And then why the Drupal.settings.mmoda on the production is an array, when it should be an object ?

motame commented 4 months ago

And then why the Drupal.settings.mmoda on the production is an array, when it should be an object ?

I noticed that too ... It has been all the time an object and not an array. It's quite strange ! I compared right now the code of mmoda.module with a version dating 2 years ago and it is an object.

vexv3DQ3Lt

volodymyrss commented 4 months ago

I confirm that it's working properly on dev instance. @burnout87, no, it did not change since the feature "enable use catalog" has been implemented.

I suppose on dev instance you have a recent version of the code?

motame commented 4 months ago

Yes, the latest one but as mentioned above, this part of the code did not change from a while (~2 years)

burnout87 commented 4 months ago

Locally I am also testing with the latest one

volodymyrss commented 4 months ago

The version in the production frontend did not change since a while. Is there a way to know reasonably easily why it broke?

motame commented 4 months ago

Did the way the Drupal.settings.mmoda object is built on the backend change @motame ?

In both places it's in fact an array indexed by the instrument short name. It has been like that since more than 2 years as attested by a diff with the commit f86561a. chrome_JJTJJHPDGy

However on prod, the array is indexed by numeric values (0,1,2 ...) !!

chrome_h5amqAdvnm

burnout87 commented 4 months ago

That object is built in the backend starting from the mmoda_settings object:

$mmoda_settings = variable_get('mmoda_settings');

https://github.com/oda-hub/mmoda-frontend-module/blob/dc104ff68f43b78cae298baea1226df1ad58fa14/mmoda.module#L362-L363

Where is that variable loaded?

motame commented 4 months ago

Where is that variable loaded?

It's an object storing all mmoda config, core and modules. It's initialized during modules installation and it is stored in the db, table "variable" as a serialized object in a BLOB. The issue could be there. ... it's not properly initialized.

motame commented 4 months ago

May be reinstalling the modules will fix the issue. @volodymyrss, note that disabling a module (drush dis -y module_name) does not uninstall it. To reinstall a module :

In addition to that the "drush pmu" command should respect the module dependency. To uninstall mmoda_integral, the sub-modules mmoda_isgri, mmoda_jemx and mmoda_spi_acs should be uninstalled first.

volodymyrss commented 4 months ago
  • drush pmu module_name

I uninstalled and re-installed all modules. Does this log look right?

Do you really want to continue? (y/n): y
mmoda_antares was successfully uninstalled.                                                                                                                                                             [ok]
mmoda_isgri was successfully uninstalled.                                                                                                                                                               [ok]
mmoda_jemx was successfully uninstalled.                                                                                                                                                                [ok]
mmoda_polar was successfully uninstalled.                                                                                                                                                               [ok]
mmoda_spi_acs was successfully uninstalled.                                                                                                                                                             [ok]
mmoda_legacysurvey was successfully uninstalled.                                                                                                                                                        [ok]
mmoda_gw was successfully uninstalled.                                                                                                                                                                  [ok]
The following modules will be uninstalled: mmoda_integral
Do you really want to continue? (y/n): y
mmoda_integral was successfully uninstalled.                                                                                                                                                            [ok]
The following modules will be uninstalled: mmoda
Do you really want to continue? (y/n): y
mmoda was successfully uninstalled.                                                                                                                                                                     [ok]

But it still does not help.