Mesuva / multi_page_selector_attribute_legacy

A concrete5 attribute to select multiple pages in a sortable list
2 stars 3 forks source link

Javascript not being loaded #3

Open melat0nin opened 9 years ago

melat0nin commented 9 years ago

It looks as though the JS in form() isn't being loaded. I've inspected using Chrome 46 and Firefox 42 and each has the table and link to the sitemap page picker, but the JS isn't in the code and so nothing is saved when a page is chosen.

Any thoughts as to why this might be?

ArniPL commented 8 years ago

I found a solution. Here it is for future reference.

Javascript is being loaded properly. But there's an issue with PageSelector helper in Concrete5. Callback function name is not passed to sitemap search selector.

Solution

In file /concrete/core/helpers/form/page_selector.php change line 50 to:

$html .= '<a class="ccm-sitemap-select-page" dialog-sender="' . $fieldName . '" dialog-width="90%" dialog-height="70%" dialog-append-buttons="true" dialog-modal="false" dialog-title="' . t('Choose Page') . '" href="' . REL_DIR_FILES_TOOLS_REQUIRED . '/sitemap_search_selector.php?sitemap_select_mode=select_page&amp;cID=' . $selectedCID . '&amp;callback='.$javascriptFunc.'">' . t('Select Page') . '</a>';

(Added callback parameter)

Of course this is simplified. You shouldn't modify /concrete folder. There are better ways to do this.

Mesuva commented 8 years ago

@ArniPL have you flagged this as something that should be fixed in the core?

ArniPL commented 8 years ago

Yes. I've created a pull request now.