Skip to content

Instantly share code, notes, and snippets.

View infabo's full-sized avatar
🏠
Working from home

Ingo Fabbri infabo

🏠
Working from home
View GitHub Profile
# Delete all duplicate sys_file_records, where one and the same sys_file UID
# is related to the same tt_content record
DELETE t_orig
FROM sys_file_reference t_orig
INNER JOIN sys_file_reference t_copy
WHERE t_orig.tablenames='tt_content'
AND t_orig.fieldname='image'
AND t_orig.deleted=0
AND t_copy.tablenames='tt_content'
AND t_copy.fieldname='image'
@wazum
wazum / StaticPaddedRangeMapper.php
Created January 28, 2019 13:40
TYPO3 CMS 9.5 StaticPaddedRangeMapper Routing Aspect
<?php
declare(strict_types=1);
namespace Vendor\Extension\Routing\Aspect;
use TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper;
/**
* Class StaticPaddedRangeMapper
* @package Vendor\Extension\Routing\Aspect
@georgringer
georgringer / setup.typoscript
Last active September 18, 2019 07:37
Google Tag Manager with CMS 9. The Site module is extended to allow site admins to edit the GTM code
page {
headerData.50 = TEXT
headerData.50 {
if.isTrue.data = site:googleTagManager
stdWrap.replacement {
10 {
search = ###CODE###
replace.data = site:googleTagManager
}
@einpraegsam
einpraegsam / InsertExample.php
Last active February 21, 2024 13:23
TYPO3 QueryBuilder example use
<?php
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
// insert into tt_content (header, crdate, pid) VALUES ("New content", 123456789, 123);
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
$queryBuilder
->insert('tt_content')
->values([
'header' => 'New content',
@schmengler
schmengler / add-checkout-form-key.sh
Last active September 2, 2022 16:23
Magento SUPEE-9767 Checkout Form Key Theme Patch
find -L app/design/frontend -regex '.*\(shipping\|billing\|shipping_method\|payment\).phtml' -exec grep -L formkey {} \; \
| xargs sed -i 's/<\/form>/<?php echo $this->getBlockHtml("formkey") ?><\/form>/g'
find -L skin/frontend -name 'opcheckout.js' -exec grep -L form_key {} \; \
| xargs sed -i 's/if (elements\[i\].name=='\''payment\[method\]'\'') {/if (elements[i].name=='\''payment[method]'\'' || elements[i].name == '\''form_key'\'') {/g'
<?php
$realurlConfig = array(
'init' => array(
// [...]
'postVarSet_failureMode'=> false,
)
// [...]
);
@markreid
markreid / gitflowrebasing.md
Created January 17, 2017 04:30
git flow with rebasing
@iamandrewluca
iamandrewluca / MyModel.php
Last active June 17, 2022 12:34
typo3 extbase categories
<?php
/**
* categories
*
* \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category>
* @lazy
*/
protected $categories;
/**
* MyModel constructor.
@helhum
helhum / deploy-to-target-info.md
Last active August 23, 2018 13:30
TYPO3 setup steps

Requirements for deployment

  • ssh (generate key and put on server)
  • rsync must be available on both machines (deployment host and target host)
  • PHP cli binary must be available on both machines (deployment host and target host)
  • composer must be available on deployment host

Needed info for each target system:

  • deploy directory
@peterjaap
peterjaap / supee-7405-1.1.md
Last active April 11, 2017 01:55
Overview of Magento patch SUPEE-7405 1.1

Patch SUPEE-7405 1.1 overview

This patch is not to be confused with the SUPEE-7405 that was released on January 20th, 2016. This is a fix for that patch.

"Yo dawg, we heard you like patching so here's a patch for your patch so you can patch while you're patching." - Xzibit, MCD+

Changed files

  • app/code/core/Mage/Adminhtml/Helper/Sales.php +1/-1
  • app/code/core/Mage/Core/Model/Config.php +2/-2
  • app/code/core/Mage/Sales/Model/Quote/Item.php +3/-2
  • lib/Varien/File/Uploader.php +2/-2
  • app/etc/applied.patches.list +7/-0