Skip to content

Commit

Permalink
Merge branch '5.x' into 6.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
angrybrad committed Jun 11, 2024
2 parents 28787b6 + 80329c8 commit 3e95e3a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Feed Me

## Unreleased

- Fixed an error that would occur when running a feed with the backup database setting enabled, when Craft's `backupCommand` was set to false. ([#1461](https://github.com/craftcms/feed-me/pull/1461))

## 6.1.0 - 2024-05-26

- Added Craft Commerce 5 compatibility. ([#1448](https://github.com/craftcms/feed-me/pull/1448/))
Expand Down
5 changes: 5 additions & 0 deletions src/services/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,11 @@ public function debugFeed($feed, $limit, $offset, $processedElementIds): void
*/
private function _backupBeforeFeed($feed): void
{
if (Craft::$app->getConfig()->getGeneral()->backupCommand === false) {
Plugin::info('Database not backed up because the backup command is false.');
return;
}

$logKey = StringHelper::randomString(20);

$limit = Plugin::$plugin->service->getConfig('backupLimit', $feed['id']);
Expand Down
4 changes: 4 additions & 0 deletions src/templates/feeds/_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
{% set title = (feed.id) ? feed.name : 'Create a new feed'|t('feed-me') %}
{% set noTabs = true %}
{% set fullPageForm = true %}
{% set backupsDisabled = craft.app.config.general.backupCommand is same as(false) %}

{% set buttons %}
<div class="buttons">
Expand Down Expand Up @@ -206,6 +207,9 @@ <h2>{{ 'Import strategy'|t('feed-me') }}</h2>
instructions: 'Perform a full backup each time this feed is processed.'|t('feed-me'),
name: 'backup',
on: (feed.id) ? feed.backup : true,
containerAttributes: backupsDisabled ? {class: ['disabled']} : {},
tip: backupsDisabled ? 'Backups are disabled while the backup command is `false`.'|t('feed-me'),
disabled: backupsDisabled,
}) }}

{{ forms.lightswitchField({
Expand Down

0 comments on commit 3e95e3a

Please sign in to comment.