Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assets/cacheabledatasource.blueprintsdatasources.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
type: 'text',
value: datasource.cache
}).appendTo(label);

// Append fieldset
Symphony.Elements.contents.find('div.actions').before(fieldset);
$('#contents div.actions').before(fieldset);
});

})(window.jQuery, window.Symphony);
28 changes: 16 additions & 12 deletions extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,16 @@ private function __fetchSectionsFromContext($context)
}

// Find any associated sections for the affected section
$associatedSections = Symphony::Database()->fetch(sprintf('
SELECT DISTINCT `child_section_id`, `parent_section_id`
FROM `tbl_sections_association`
WHERE `parent_section_id` = %1$d OR `child_section_id` = %1$d',
$affectedSection
));
$associatedSections = Symphony::Database()
->select(['child_section_id', 'parent_section_id'])
->distinct()
->from('tbl_sections_association')
->where(['or' => [
['parent_section_id' => $affectedSection],
['child_section_id' => $affectedSection],
]])
->execute()
->rows();

General::flattenArray($associatedSections);
$associatedSections = array_values($associatedSections);
Expand Down Expand Up @@ -265,7 +269,7 @@ public function dataSourcePreExecute($context)

// Add an attribute to preg_replace later
$xml->setAttribute("cache-age", "fresh");

// Add an attribute cache-expiration
$xml->setAttribute("cache-expiration", $ds->dsParamCACHE);

Expand Down Expand Up @@ -293,7 +297,7 @@ private function __buildCacheFilename($datasource, &$filename, &$file_age)
{
$filename = null;



// Checks if cacheabledatasource directory exists. If not, try to restore.
if (!file_exists(CACHE . '/cacheabledatasource')) {
Expand Down Expand Up @@ -326,7 +330,7 @@ private function __buildCacheFilename($datasource, &$filename, &$file_age)
if (!file_exists($filename)) {
return false;
}

// Check if cache is infinite
if ($datasource->dsParamCACHE === -1) {
return true;
Expand Down Expand Up @@ -455,16 +459,16 @@ public function initaliseAdminPageHead($context)
}

$url_context = $page->getContext();
if (!in_array($url_context[0], array('new', 'edit'))) {
if (!in_array($url_context['action'], array('new', 'edit'))) {
return;
}

$cache = 0;

// if editing an existing data source, instantiate the DS object
// to retrieve the dsParamCACHE property if it exists
if ($url_context[0] == 'edit') {
$ds = $url_context[1];
if ($url_context['action'] == 'edit') {
$ds = $url_context['handle'];
$dsm = new DatasourceManager(Symphony::Engine());
$datasource = $dsm->create($ds, null, false);
$cache = $datasource->dsParamCACHE;
Expand Down
10 changes: 10 additions & 0 deletions extension.meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
</author>
</authors>
<releases>
<release version="3.0.0" date="TBA" min="4.0.0" max="4.x.x" php-min="5.6.x" php-max="7.x.x">
- Update for Symphony 4.x
- Code refactoring for Database and EQFA
</release>
<release version="2.5.2" date="2018-01-18" min="2.6.0" max="2.x.x">
- Code fix: Use CACHE for consistentcy (#28)
</release>
Expand All @@ -31,6 +35,12 @@
<release version="2.4.0" date="2017-10-27" min="2.6.0" max="2.x.x">
- Add cache-expiration attribute in Data Source (#24)
</release>
<release version="2.3.3" date="2017-07-13" min="2.6.0" max="2.x.x">
- Fix regression with ignored data sources (#22)
</release>
<release version="2.3.2" date="2017-05-31" min="2.6.0" max="4.x.x">
- PHP7 Compatibility
</release>
<release version="2.3.2" date="2017-07-13" min="2.6.0" max="2.x.x">
- Fix regression with ignored data sources (#22)
</release>
Expand Down