Skip to content

Instantly share code, notes, and snippets.

View wsydney76's full-sized avatar
💭
Retired. Likely to respond slowly

Werner wsydney76

💭
Retired. Likely to respond slowly
  • Munich, Germany
View GitHub Profile
@wsydney76
wsydney76 / MigrationController.php
Created March 19, 2024 18:17
Get fields in Craft CMS 5 with identical settings
<?php
// ....
public function actionConsolidateFieldsCandidates()
{
$signatures = [];
foreach (Craft::$app->getFields()->getAllFields() as $field) {
$signature = [
@wsydney76
wsydney76 / MigrationController.php
Last active April 24, 2024 05:04
Craft CMS CLI command that helps to detect errors after migration to Craft 5 (renamed entry types etc.)
<?php
namespace modules\main\console\controllers;
use Craft;
use craft\console\Controller;
use craft\elements\Entry;
use craft\helpers\Console;
use GuzzleHttp\Exception\GuzzleException;
use yii\console\ExitCode;
@wsydney76
wsydney76 / CollapseSidebarAsset.php
Last active February 29, 2024 19:28
Make sections of Craft 5 element indexes collapsible
<?php
namespace modules\main\web\assets\collapsesidebar;
use craft\web\AssetBundle;
/**
* Collapse Sidebar asset bundle
* Experimental!
*