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
2 changes: 1 addition & 1 deletion .github/workflows/diagnostics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3' ]
php: [ '8.2', '8.3' ]
contao: [ '~4.13.0' ]
phpcq_install: [ 'update' ]
output: [ '-o github-action -o default' ]
Expand Down
11 changes: 11 additions & 0 deletions .phpcq.yaml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ phpcq:
phpunit:
version: ^1.0
signed: false
requirements:
phpunit:
version: ^11.5.48
psalm:
version: ^1.0
signed: false
Expand Down Expand Up @@ -39,22 +42,30 @@ phpcq:
trusted-keys:
# composer-require-checker
- 033E5F8D801A2F8D
- B2BDAAAC6F1FDE528CD9EEC9033E5F8D801A2F8D
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While these are not wrong, they point to a bug in phpcq... Apparently the cli of gnupg uses a different key fingerprint hash len than the php pgp extension.

We should fix this upstream and then remove them here again.

# sb@sebastian-bergmann.de
- 4AA394086372C20A
- D8406D0D82947747293778314AA394086372C20A
# psalm
- 8A03EA3B385DBAA1
- 12CE0F1D262429A5
- 2DE50EB60C013FFFA831040D12CE0F1D262429A5
# magl@magll.net
- D2CCAC42F6295E7D
# PHP_CodeSniffer
- 31C7E470E2138192
- 5E6DDE998AB73B8E
- A978220305CD5C32
- 689DAD778FF08760E046228BA978220305CD5C32
- 97B02DD8E5071466
- D91D86963AF3A29B6520462297B02DD8E5071466
# Composer normalize
- C00543248C87FB13
- 0FDE18AE1D09E19F60F6B1CBC00543248C87FB13
# phpmd
- A4E55EA12C7C085C
- 9093F8B32E4815AA
- E7A745102ECC980F7338B3079093F8B32E4815AA

tasks:
fix:
Expand Down
11 changes: 9 additions & 2 deletions src/EventListener/BackendEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,18 @@ private function duplicateContentEntries(string $strTable, int $intSourceId, int
$arrContent['pid'] = $intDestinationId;
unset($arrContent['id']);

$parameters = [];
foreach (array_keys($arrContent) as $key) {
$parameters[$key] = '?';
}

$this->connection
->createQueryBuilder()
->insert('tl_content')
->setParameters($arrContent)
->executeQuery();
->values($parameters)
->setParameters(array_values($arrContent))
->executeStatement()
;
}
}
}
5 changes: 4 additions & 1 deletion tests/Widgets/ContentArticleWidgetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ public function testNewInstance(): void
$widget
->expects(self::any())
->method('import')
->withConsecutive([Config::class, 'Config']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this whole block rathe be:

        $widget
            ->expects($this->once())
            ->method('import')
            ->with(Config::class, 'Config');

->willReturnCallback(function ($parameters) {
$this->assertInstanceof(Config::class, $parameters[0]);
$this->assertSame('Config', $parameters[1]);
});

self::assertEmpty($widget->getAttributes());
}
Expand Down