OpenDevelopmentMekong / wp-odm_tabular_pages

Internal ODM Wordpress plugin for exposing a page template for tabular pages
https://opendevelopmentmekong.net
GNU General Public License v3.0
0 stars 2 forks source link

Javascript error when number of columns is not 4 #89

Closed acorbi closed 7 years ago

acorbi commented 7 years ago

Currently, the laws pages on ODC are configured to present the information in 4 columns. See https://pp.opendevelopmentcambodia.net/tabular/laws-profiles-and-agreements/

screenshot from 2016-12-30 10-59-49

If one column is removed, a javascript error gets thrown:

screenshot from 2016-12-30 11-02-40

The problem probably relies on the fact that there is some code which takes for granted that there are ALWAYS 4 columns configured. Probably, following line is relevant:

https://github.com/OpenDevelopmentMekong/wp-odm_tabular_pages/blob/master/post-types/templates/single-tabular.php#L361

This needs to be coded in a generic/flexible way.

@Huyeng you were working recently with the column width. can you please take over this task?

Huyeng commented 7 years ago

I will help to fix this.

Huyeng commented 7 years ago

I don't have any problem with removing the column, see the screenshot below: screenshot_2

acorbi commented 7 years ago

@Huyeng I already opened a PR some days ago with the fix for this issue. Please review https://github.com/OpenDevelopmentMekong/wp-odm_tabular_pages/pull/90 and merge if you agree.