agiliway / com.agiliway.civicalendar

CiviCalendar Extension
Other
7 stars 13 forks source link

Errors on dashlet display and installation on multilingual site #26

Closed jaomalley closed 8 months ago

jaomalley commented 3 years ago

Thanks for all your work! We really appreciate it!

I am seeing some problems with Drupal 9, Civicrm 5.36.0 with php 7.3, but this goes back to Drupal 8 and Civicrm 5.25.0.

I couldn't get the extension to work properly with a dual language setup.Install throws an error because it cannot find the table field "label" in civicrm_dashboard. In a multilingual setup "label" appears as "label_es_ES", "label_en_US", for example.

If I force the install manually, the calendar dashlet throws this error again that it cannot find /civicrm/dashlet/calendar?reset=1&snippet=json (page not found).

I'm going to assume it's a language thing again.

I will dig into the code and see if I can figure out how languages are navigated in civicrm, but I thought I would raise the issue here in case this is something simple.

mlutfy commented 3 years ago

in sql/install.sql, replace label by label_es_ES, then enable the extension.

Fixing this requires re-thinking a bit. The SQL could be place into CRM_Core_DAO::executeQuery statements, but it's a ManagedEntity, and it would be better to use that instead.

jaomalley commented 3 years ago

Thank you for your response. That workaround worked for me. In the interest of having it work out of the box, I dug into the extension and it seems it was not build with automated scaffolding through civix.

I couldn't come up with a future proof quick fix for the install.sql.

I tried unsuccessfully to refactor the extension using the current scaffolding.

mlutfy commented 3 years ago

I did a PR in #28 that uses the hook for managed entities.