Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
😄

Takuro Hishikawa hissy

💭
😄
View GitHub Profile
@hissy
hissy / Output.md
Last active Mar 15, 2022
[Concrete CMS][8.5.x] Show cache settings of block types ブロックタイプごとのキャッシュ設定
View Output.md
Name Handle Cache Settings Cache Output Cache Output on Post Cache Output For Registered Users Output Cache Lifetime
記事 content 有効 有効 有効 無効 0
HTML html 有効 有効 有効 有効 0
画像 image 有効 有効 有効 無効 0
ファイル file 有効 有効 有効 有効 0
水平線 horizontal_rule 有効 有効 有効 有効 0
特色 feature 有効 有効 有効 有効 0
オートナビ autonav 有効 有効 有効 無効 300
ページタイトル page_title 有効 有効 有効 無効 0
@hissy
hissy / readme.md
Last active Feb 25, 2022
#ConcreteCMS Migrate legacy database connection to doctrine
View readme.md
@hissy
hissy / anonymize.php
Created Feb 11, 2022
#ConcreteCMS Tiny script to anonymize users
View anonymize.php
<?php
use Concrete\Core\Support\Facade\Application;
use Concrete\Core\User\UserInfoRepository;
$app = Application::getFacadeApplication();
/** @var UserInfoRepository $repository */
$repository = $app->make(UserInfoRepository::class);
$updated = 0;
$failed = 0;
@hissy
hissy / five_columns_grid.php
Created Dec 20, 2021
#ConcreteCMS #Containers Dynamic Grid Columns Container example
View five_columns_grid.php
<?php
defined('C5_EXECUTE') or die("Access Denied.");
/** @var $c \Concrete\Core\Page\Page */
/** @var $container \Concrete\Core\Entity\Page\Container */
use Concrete\Core\Area\ContainerArea;
?>
<div class="grid grid-cols-2 md:grid-cols-4 xl:grid-cols-5 gap-x-4 gap-y-8">
@hissy
hissy / README.md
Last active Jan 17, 2022
#ConcreteCMS #V8 Override jQuery to 3.5, jQuery UI to 1.13.0 on Concrete CMS version 8.5.x
View README.md

English

Overview

Concrete CMS version 8 uses jQuery 1.22.2 and jQuery UI 1.12.1, but these versions have officially been marked as the end of life. These libraries have some vulnerabilities, but the jQuery team won't fix them. They announced you should upgrade jQuery 3.5.0 or later.

The core team of Concrete CMS does not plan to update jQuery on version 8.x for backward compatibility. If you can update to Concrete CMS version 9, it'd be best to fix those vulnerabilities.

@hissy
hissy / view.php
Last active Dec 1, 2021
#ConcreteCMS Get conversation messages count by Page object
View view.php
<?php
/** @var \Concrete\Core\Page\Page $page */
$totalMessages = 0;
foreach ($page->getBlocks() as $block) {
if ($block->getBlockTypeHandle() === 'core_conversation') {
/** @var \Concrete\Core\Conversation\Conversation $conversation */
$conversation = $block->getController()->getConversationObject();
if ($conversation) {
$totalMessages = $conversation->getConversationMessagesTotal();
}
@hissy
hissy / page_forbidden.php
Created Jul 5, 2021
[concrete5][V8] Keep query parameters on forwarding to login page from page forbidden
View page_forbidden.php
<?php
namespace Application\Controller\SinglePage;
use Concrete\Core\Http\ResponseFactoryInterface;
use Concrete\Core\Url\Resolver\Manager\ResolverManagerInterface;
use Concrete\Core\Url\UrlImmutable;
use Concrete\Core\User\User;
use Symfony\Component\HttpFoundation\Response;
@hissy
hissy / EventService.php
Created Apr 6, 2021
[concrete5] [V8] Create a draft detail page if you make a draft calendar event, and approve the page when you publish that event.
View EventService.php
<?php
// application/src/Calendar/Event/EventService.php
namespace Application\Calendar\Event;
use Concrete\Core\Entity\Calendar\Calendar;
use Concrete\Core\Entity\Calendar\CalendarEvent;
use Concrete\Core\Entity\Calendar\CalendarEventVersion;
use Concrete\Core\Page\Page;
use Concrete\Core\Page\Type\Type;
@hissy
hissy / README.md
Last active Mar 23, 2021
[concrete5][V8] Check all database migrations already run or missed
View README.md

This script is related with migration error on upgrade from 8.5.2 or before.

concretecms/concretecms#8771

You can check if there're missing migrations on your concrete5 site before upgrade it.

How to run the script

  1. Download checkMigrations.php and upload it
  2. Run it with c5:exec command
@hissy
hissy / HttpServiceProvider.php
Last active Dec 16, 2020
[concrete5] [V8] Fix: IE tries to download json file when you hit save button of content block
View HttpServiceProvider.php
<?php
namespace Application\Http;
use Concrete\Core\Http\ResponseFactoryInterface;
class HttpServiceProvider extends \Concrete\Core\Http\HttpServiceProvider
{
public function register()
{
parent::register();