Feature #27368
Enable JS inclusion on pages which show the content of other pages with a powermail form
| Status: | Resolved | Start date: | 2011-06-10 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
| Votes: | 0 |
Description
Problem¶
The function 'user_powermailOnCurrentPage' checks whether a powermail CE is included on the current page and in case of yes including some JS files in the page header.
But if the content from the current page is not from that page but included from another page, the function will not find a powermail CE.
Solution¶
Make the function able to check if the current page has a value in the field 'content_from_pid' and if so check that page as well for powermail CE.
file 'lib/user_powermailOnCurrentPage.php', line 33:
replace this line with the following line:
$where_clause = ' (pid = ' . ($GLOBALS['TSFE']->id ? $GLOBALS['TSFE']->id : 0) . ' OR pid = (SELECT content_from_pid FROM pages WHERE uid = ' . ($GLOBALS['TSFE']->id ? $GLOBALS['TSFE']->id : 0) . ')) AND CType = "powermail_pi1" ' . (!is_array($TCA['tt_content']) ? 'AND deleted = 0 AND hidden = 0' : $GLOBALS['TSFE']->sys_page->enableFields('tt_content')),
Thus the SQL statement generated will be extended to:
SELECT uid FROM tt_content WHERE ( pid = [current TSFE_id] OR pid = (SELECT content_from_pid FROM pages WHERE uid = [current TSFE_id] ) ) AND CType = "powermail_pi1" AND deleted = 0 AND hidden = 0
Advantage¶
You may ask: why the hell will they want to do that? With this patch we are now able to produce one master form and configure it properly and then include it on any page we like. The export data will always be on that master form page. It saves a lot of time when you administrate a huge page with many forms.
History
Updated by Stefan Padberg almost 2 years ago
seems to be done in later versions.
Updated by Alexander Grein almost 2 years ago
- Status changed from New to Needs Feedback
Is this issue already fixed?
Updated by Alexander Grein almost 2 years ago
- Status changed from Needs Feedback to Resolved