author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
95,144
24.02.2020 18:38:03
-3,600
cc4a4140bdbe94e972b1c670b1dd3daea4ecfad8
Allow singular slug as CT in `setcontent`
[ { "change_type": "MODIFY", "old_path": "public/theme/skeleton/partials/_aside.twig", "new_path": "public/theme/skeleton/partials/_aside.twig", "diff": "<div>\n{# The next section attempts to fill the panel in the sidebar with the contents of the\n'about'-block, if it exists. First, attempt to fetch the block by its slug #}\n- {% setcontent block = \"blocks/about\" %}\n+ {% setcontent block = \"block/about\" %}\n{# check if we have a title. If so, we know we have content to display. Otherwise, we will\noutput a default text, telling the user to create the 'blocks' in the backend. #}\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/Config.php", "new_path": "src/Configuration/Config.php", "diff": "@@ -175,9 +175,22 @@ class Config\npublic function getContentType(string $name): ?Collection\n{\n+ if ($this->has('contenttypes/' . $name)) {\nreturn $this->get('contenttypes/' . $name);\n}\n+ $cts = $this->get('contenttypes');\n+\n+ foreach (['singular_slug', 'name', 'singular_name'] as $key) {\n+ /** @var Collection $cts */\n+ if ($cts->firstWhere($key, $name)) {\n+ return $cts->firstWhere($key, $name);\n+ }\n+ }\n+\n+ return null;\n+ }\n+\npublic function getFileTypes(): Collection\n{\nreturn new Collection($this->get('general/accept_file_types'));\n" }, { "change_type": "MODIFY", "old_path": "src/Storage/ContentQueryParser.php", "new_path": "src/Storage/ContentQueryParser.php", "diff": "@@ -4,6 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Storage;\n+use Bolt\\Configuration\\Config;\nuse Bolt\\Entity\\Content;\nuse Bolt\\Repository\\ContentRepository;\nuse Bolt\\Storage\\Directive\\GetQueryDirective;\n@@ -68,10 +69,13 @@ class ContentQueryParser\n/** @var RequestStack */\nprivate $requestStack;\n+ /** @var Config */\n+ private $config;\n+\n/**\n* Constructor.\n*/\n- public function __construct(RequestStack $requestStack, ContentRepository $repo, ?QueryInterface $queryHandler = null)\n+ public function __construct(RequestStack $requestStack, ContentRepository $repo, Config $config, ?QueryInterface $queryHandler = null)\n{\n$this->repo = $repo;\n$this->requestStack = $requestStack;\n@@ -81,6 +85,7 @@ class ContentQueryParser\n}\n$this->setupDefaults();\n+ $this->config = $config;\n}\n/**\n@@ -154,7 +159,7 @@ class ContentQueryParser\n$tok = strtok($delim);\n}\n- $this->contentTypes = $content;\n+ $this->setContentTypes($content);\n}\n/**\n@@ -258,6 +263,23 @@ class ContentQueryParser\nreturn $this->repo;\n}\n+ public function setContentTypes(array $contentTypes): void\n+ {\n+ // Verify if we're attempting to get valid ContentTypes\n+ foreach ($contentTypes as $key => $value) {\n+ $configCT = $this->config->getContentType($value);\n+\n+ if (! $configCT) {\n+ $message = sprintf(\"Tried to get content from ContentType '%s', but no ContentType by that name/slug exists.\", $value);\n+ throw new \\Exception($message);\n+ }\n+\n+ $contentTypes[$key] = $configCT->get('slug');\n+ }\n+\n+ $this->contentTypes = $contentTypes;\n+ }\n+\n/**\n* Returns the parsed content types.\n*/\n" } ]
PHP
MIT License
bolt/core
Allow singular slug as CT in `setcontent`
95,144
25.02.2020 16:25:17
-3,600
b2f3a1b9b3d3c9b094ce0927b714aab65990d65f
If strength == false, make sure it propagates to Vue component
[ { "change_type": "MODIFY", "old_path": "templates/_partials/fields/password.html.twig", "new_path": "templates/_partials/fields/password.html.twig", "diff": ":value='{{ value|json_encode }}'\n:label='{{ label|json_encode }}'\n:label_class='{{ label_class|default()|json_encode }}'\n- :strength='{{ strength|default()|json_encode }}'\n+ :strength='{{ strength|default(false)|json_encode }}'\n:class='{{ class|json_encode }}'\n:hidden='{{ hidden|default('true') }}'\n:required='{{ required|json_encode }}'\n" } ]
PHP
MIT License
bolt/core
If strength == false, make sure it propagates to Vue component
95,144
25.02.2020 16:57:56
-3,600
43c6b63e7a8924b7649909ce81e0a8b2299013b3
add some waiting in tests
[ { "change_type": "MODIFY", "old_path": "behat.yml", "new_path": "behat.yml", "diff": "@@ -21,7 +21,7 @@ default:\nextensions:\nLakion\\Behat\\MinkDebugExtension:\ndirectory: var/log/behat-reports\n- screenshot: false\n+ screenshot: true\nBehat\\MinkExtension:\nbrowser_name: chrome\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/bulk_actions.feature", "new_path": "tests/e2e/bulk_actions.feature", "diff": "@@ -12,6 +12,7 @@ Feature: Bulk content listing actions\nAnd the 1st \"Update all\" button should be disabled\n@javascript\n+\nScenario: As an Admin I want to change the status of several tests at once\nGiven I am logged in as \"admin\"\nAnd I am on \"/bolt/content/tests\"\n@@ -26,6 +27,7 @@ Feature: Bulk content listing actions\n# When I click \"Change status to 'draft'\"\nWhen I click \"aside .card-body .multiselect__content-wrapper > ul > li:nth-child(2)\"\n+ And I wait 0.1 second\nThen the 1st \"Update all\" button should be enabled\nWhen I press \"Update all\"\n@@ -37,9 +39,10 @@ Feature: Bulk content listing actions\nWhen I click \".listing__filter .custom-checkbox\"\nAnd I click \"aside .card-body .multiselect__select\"\n+\n# And I click \"Change status to 'publish'\"\nAnd I click \"aside .card-body .multiselect__content-wrapper > ul > li:nth-child(1)\"\n-\n+ And I wait 0.1 second\nThen the 1st \"Update all\" button should be enabled\nWhen I press \"Update all\"\n" } ]
PHP
MIT License
bolt/core
add some waiting in tests
95,144
27.02.2020 06:47:01
-3,600
d51429f9bc266ea8bffa6d04d5ff7f3dafea3f35
Omit Title in Excerpt by default
[ { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -168,7 +168,7 @@ class ContentExtension extends AbstractExtension\n* @param string|Markup|Content $content\n* @param string|array|null $focus\n*/\n- public function getExcerpt($content, int $length = 280, bool $includeTitle = true, $focus = null): string\n+ public function getExcerpt($content, int $length = 280, bool $includeTitle = false, $focus = null): string\n{\nif (is_string($content) || $content instanceof Markup) {\nreturn Excerpt::getExcerpt((string) $content, $length);\n" } ]
PHP
MIT License
bolt/core
Omit Title in Excerpt by default
95,144
27.02.2020 07:04:44
-3,600
7c695ce9c6c2bb8b5a7acdda369164292c079390
Allow for adding locales to `config/services.yaml`
[ { "change_type": "MODIFY", "old_path": "config/packages/translation.yaml", "new_path": "config/packages/translation.yaml", "diff": "@@ -8,7 +8,6 @@ framework:\ntranslation:\nwebui:\nenabled: true\n- locales: ['en', 'nl', 'es', 'fr', 'de', 'pl', 'it', 'hu', 'pt_BR', 'is', 'jp', 'nb', 'dk', 'pl']\nedit_in_place:\nenabled: false\nconfigs:\n" }, { "change_type": "MODIFY", "old_path": "config/services.yaml", "new_path": "config/services.yaml", "diff": "parameters:\nlocale: 'en'\n# This parameter defines the codes of the locales (languages) enabled in the application\n- app_locales: en|nl|es|fr|de|pl|it|hu|pt_BR|ja|nb|nn|nl_NL|nl_BE\n+ app_locales: en|nl|es|fr|de|pl|it|hu|pt_BR|ja|nb|nn|nl_NL|nl_BE|is|ru\napp.notifications.email_sender: anonymous@example.com\nbolt.table_prefix: bolt_\nbolt.backend_url: /bolt\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/ContentTypesParser.php", "new_path": "src/Configuration/Parser/ContentTypesParser.php", "diff": "@@ -21,7 +21,7 @@ class ContentTypesParser extends BaseParser\n/** @var array */\nprivate $localeCodes = [];\n- public function __construct(string $locales, string $projectDir, Collection $generalConfig, string $filename = 'contenttypes.yaml')\n+ public function __construct(?string $locales = null, string $projectDir, Collection $generalConfig, string $filename = 'contenttypes.yaml')\n{\n$this->localeCodes = empty($locales) ? [] : explode('|', $locales);\n$this->generalConfig = $generalConfig;\n" }, { "change_type": "MODIFY", "old_path": "src/Kernel.php", "new_path": "src/Kernel.php", "diff": "@@ -123,7 +123,7 @@ class Kernel extends BaseKernel\n*/\nprivate function setContentTypeRequirements(ContainerBuilder $container): void\n{\n- $ContentTypesParser = new ContentTypesParser('en|nl|es|fr|de|pl|it|hu|pt_BR|ja|nb|nn|nl_NL|nl_BE', $this->getProjectDir(), new Collection());\n+ $ContentTypesParser = new ContentTypesParser(null, $this->getProjectDir(), new Collection());\n$contentTypes = $ContentTypesParser->parse();\n$pluralslugs = $contentTypes->pluck('slug')->implode('|');\n" } ]
PHP
MIT License
bolt/core
Allow for adding locales to `config/services.yaml`
95,144
28.02.2020 16:21:07
-3,600
f2deaf4d7ef0bcb1c376aa6b91758bdd8efd82f6
Typo in `.env.dist`
[ { "change_type": "MODIFY", "old_path": ".env.dist", "new_path": ".env.dist", "diff": "@@ -12,7 +12,7 @@ APP_SECRET=73fd814e2c9fbf61dc5f87a62967d829\n###> doctrine/doctrine-bundle ###\n-# uncomment the appropiate line(s) below to set the database using a DSN (data source name)\n+# Uncomment the appropriate line(s) below to set the database using a DSN (data source name)\n# Replace `db_user`, `db_password` and `db_name` where needed. Depending on your server settings,\n# you might also need to configure the host (\"localhost\" / \"127.0.0.1\") or the port number (\"3306\")\n# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url\n" } ]
PHP
MIT License
bolt/core
Typo in `.env.dist`
95,144
28.02.2020 18:15:53
-3,600
cd2c9d8b8e516807b4dda9e95cc6c7fd0f90a7f1
A number of smaller fixes to overview pages
[ { "change_type": "MODIFY", "old_path": "assets/js/app/listing/Components/Table/Row/_Meta.vue", "new_path": "assets/js/app/listing/Components/Table/Row/_Meta.vue", "diff": ":class=\"`is-${record.status}`\"\n:title=\"record.status\"\n></span\n- >{{ record.publishedAt | date }}\n+ >{{ record.publishedAt ? record.publishedAt : record.createdAt | date }}\n</li>\n<li v-if=\"size === 'normal'\">\n<i class=\"fas fa-user\"></i> {{ record.authorName }}\n" }, { "change_type": "MODIFY", "old_path": "assets/js/app/listing/Components/Table/Row/index.vue", "new_path": "assets/js/app/listing/Components/Table/Row/index.vue", "diff": ":class=\"`is-${size}`\"\n@mouseleave=\"leave\"\n>\n- <!-- column thumbnail -->\n- <div\n- v-if=\"size === 'normal' && record.extras.image\"\n- class=\"listing__row--item is-thumbnail\"\n- :style=\"`background-image: url('${record.extras.image.thumbnail}')`\"\n- ></div>\n- <!-- end column -->\n-\n- <!-- column details -->\n+ <!-- column details / excerpt -->\n<div class=\"listing__row--item is-details\">\n<a\nclass=\"listing__row--item-title\"\n:href=\"record.extras.editLink\"\n:title=\"slug\"\n>\n- {{ record.extras.title | trim(62) }}\n+ {{ record.extras.title | trim(62) | raw }}\n</a>\n<span class=\"listing__row--item-title-excerpt\">{{\n- record.extras.excerpt\n+ record.extras.excerpt | raw\n}}</span>\n</div>\n<!-- end column -->\n+ <!-- column thumbnail -->\n+ <div\n+ v-if=\"size === 'normal' && record.extras.image\"\n+ class=\"listing__row--item is-thumbnail\"\n+ :style=\"`background-image: url('${record.extras.image.thumbnail}')`\"\n+ ></div>\n+ <!-- end column -->\n+\n<!-- column meta -->\n<row-meta :type=\"type\" :size=\"size\" :record=\"record\"></row-meta>\n<!-- end column -->\n" }, { "change_type": "MODIFY", "old_path": "assets/js/filters/string.js", "new_path": "assets/js/filters/string.js", "diff": "@@ -19,6 +19,14 @@ Vue.filter('strip', string => {\n}\n});\n+Vue.filter('raw', string => {\n+ if (string) {\n+ let node = document.createElement(\"textarea\");\n+ node.innerHTML = string;\n+ return node.value;\n+ }\n+});\n+\nVue.filter('uppercase', string => {\nif (string) return string.toUpperCase();\n});\n" }, { "change_type": "MODIFY", "old_path": "assets/scss/layout/_admin.scss", "new_path": "assets/scss/layout/_admin.scss", "diff": "@@ -110,13 +110,13 @@ body {\n//grid with autofit to make columns expand full width if other column(s) not present\ngrid-template-columns: repeat(12, 1fr);\ngrid-template-rows: auto;\n- grid-column-gap: 2rem;\n- padding: $spacer $spacer*2 $spacer $spacer*2; //do not just change this as it's tied to the main grid and other paddings/gutters\n+ grid-column-gap: 3rem;\n+ padding: $spacer $spacer*2 $spacer $spacer*3; //do not just change this as it's tied to the main grid and other paddings/gutters\n}\n@include media-breakpoint-up(xw) {\n- grid-column-gap: 3rem;\n- padding: $spacer $spacer*3 $spacer $spacer*3; //do not just change this as it's tied to the main grid and other paddings/gutters\n+ grid-column-gap: 4rem;\n+ padding: $spacer $spacer*3 $spacer $spacer*4; //do not just change this as it's tied to the main grid and other paddings/gutters\n}\n&--has-sidebar {\n" }, { "change_type": "MODIFY", "old_path": "assets/scss/modules/admin/_header.scss", "new_path": "assets/scss/modules/admin/_header.scss", "diff": "}\n@include media-breakpoint-up(wd) {\n- padding: $spacer*1.25 $spacer*2 1rem $spacer*2; //do not just change this as it's tied to the main grid and other paddings/gutters\n+ padding: $spacer*1.25 $spacer*2 1rem $spacer*3; //do not just change this as it's tied to the main grid and other paddings/gutters\n}\n@include media-breakpoint-up(xw) {\n- padding: $spacer*1.25 $spacer*3 1rem $spacer*3; //do not just change this as it's tied to the main grid and other paddings/gutters\n+ padding: $spacer*1.25 $spacer*3 1rem $spacer*4; //do not just change this as it's tied to the main grid and other paddings/gutters\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "assets/scss/modules/listing/row/row.scss", "new_path": "assets/scss/modules/listing/row/row.scss", "diff": "@@ -82,7 +82,7 @@ $checkbox-row-width: 32px;\n}\n@include media-breakpoint-up(md) {\n- order: 1;\n+ order: 2;\ntop: 0;\nmax-height: none;\n}\n@@ -111,7 +111,7 @@ $checkbox-row-width: 32px;\nmax-height: 4.75rem;\n@include media-breakpoint-up(md) {\n- order: 2;\n+ order: 1;\nflex: 1 0 290px;\npadding: $spacer*0.4 $spacer $spacer*0.5 $spacer*0.625;\nmargin-bottom: 0;\n@@ -149,7 +149,7 @@ $checkbox-row-width: 32px;\n}\n@include media-breakpoint-up(md) {\n- order: 2;\n+ order: 1;\nflex: 1 1 auto;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/ContentTypesParser.php", "new_path": "src/Configuration/Parser/ContentTypesParser.php", "diff": "@@ -315,7 +315,7 @@ class ContentTypesParser extends BaseParser\nprivate function determineSort(array $contentType): string\n{\n- $sort = $contentType['sort'] ?? 'id';\n+ $sort = $contentType['sort'] ?? '-createdAt';\n$replacements = [\n'created' => 'createdAt',\n@@ -336,8 +336,8 @@ class ContentTypesParser extends BaseParser\n$sortname = trim($sort, '-');\nif (! in_array($sortname, array_keys($contentType['fields']), true) &&\n- ! in_array($sortname, ['createdAt', 'modifiedAt', 'publishedAt'], true)) {\n- $sort = 'id';\n+ ! in_array($sortname, ['createdAt', 'modifiedAt', 'publishedAt', 'id'], true)) {\n+ $sort = '-createdAt';\n}\nreturn $sort;\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/ContentOverviewController.php", "new_path": "src/Controller/Backend/ContentOverviewController.php", "diff": "@@ -31,6 +31,8 @@ class ContentOverviewController extends TwigAwareController implements BackendZo\nif ($request->get('sortBy')) {\n$params['order'] = $request->get('sortBy');\n+ } else {\n+ $params['order'] = $contentTypeObject->get('sort');\n}\nif ($request->get('filter')) {\n" } ]
PHP
MIT License
bolt/core
A number of smaller fixes to overview pages
95,144
29.02.2020 09:50:38
-3,600
6291cba9ed16e5fb1f139aaede11df3edf51bb51
For tests we should keep these ordered by id
[ { "change_type": "MODIFY", "old_path": "config/bolt/contenttypes.yaml", "new_path": "config/bolt/contenttypes.yaml", "diff": "@@ -98,6 +98,7 @@ pages:\nfilter: '*.twig'\ntaxonomy: [ groups ]\nlisting_records: 6\n+ sort: id\nlocales: ['en', 'nl', 'ja', 'nb']\n# Entries can be used for things like 'news' or 'blogpostings'. They have a\n" } ]
PHP
MIT License
bolt/core
For tests we should keep these ordered by id
95,144
29.02.2020 15:41:09
-3,600
c962df1576594f24d4053120c0e8d2664804ece6
Don't show orphaned content on Dashboard if a ContentType was removed
[ { "change_type": "MODIFY", "old_path": "src/Controller/Backend/DashboardController.php", "new_path": "src/Controller/Backend/DashboardController.php", "diff": "@@ -4,6 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Controller\\Backend;\n+use Bolt\\Configuration\\Config;\nuse Bolt\\Controller\\TwigAwareController;\nuse Bolt\\Entity\\Content;\nuse Bolt\\Repository\\ContentRepository;\n@@ -20,13 +21,14 @@ class DashboardController extends TwigAwareController implements BackendZoneInte\n/**\n* @Route(\"/\", name=\"bolt_dashboard\", methods={\"GET\"})\n*/\n- public function index(ContentRepository $content, Request $request): Response\n+ public function index(ContentRepository $content, Request $request, Config $config): Response\n{\n- $amount = $this->config->get('general/records_per_page', 10);\n+ $amount = (int) $this->config->get('general/records_per_page', 10);\n$page = (int) $request->get('page', 1);\n+ $contentTypes = $config->get('contenttypes');\n/** @var Content $records */\n- $records = $content->findLatest(null, $page, $amount);\n+ $records = $content->findLatest($contentTypes, $page, $amount);\nreturn $this->renderTemplate('@bolt/pages/dashboard.html.twig', [\n'records' => $records,\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/GeneralController.php", "new_path": "src/Controller/Backend/GeneralController.php", "diff": "@@ -4,6 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Controller\\Backend;\n+use Bolt\\Configuration\\Config;\nuse Bolt\\Controller\\TwigAwareController;\nuse Bolt\\Entity\\Content;\nuse Bolt\\Repository\\ContentRepository;\n@@ -44,10 +45,12 @@ class GeneralController extends TwigAwareController implements BackendZoneInterf\n/**\n* @Route(\"/kitchensink\", name=\"bolt_kitchensink\")\n*/\n- public function kitchensink(ContentRepository $content): Response\n+ public function kitchensink(ContentRepository $content, Config $config): Response\n{\n+ $contentTypes = $config->get('contenttypes');\n+\n/** @var Content $records */\n- $records = $content->findLatest(null, 1, 4);\n+ $records = $content->findLatest($contentTypes, 1, 4);\n$this->addFlash('success', '<strong>Well done!</strong> You successfully read this important alert message.');\n$this->addFlash('info', '<strong>Heads up!</strong> This alert needs your attention, but it\\'s not super important.');\n" }, { "change_type": "MODIFY", "old_path": "src/Repository/ContentRepository.php", "new_path": "src/Repository/ContentRepository.php", "diff": "@@ -63,19 +63,21 @@ class ContentRepository extends ServiceEntityRepository\nreturn $this->createPaginator($qb->getQuery(), $page, $amountPerPage);\n}\n- public function findLatest(?ContentType $contentType = null, int $page = 1, int $amount = 6): Pagerfanta\n+ public function findLatest(Collection $contentTypes, int $page = 1, int $amount = 6): Pagerfanta\n{\n$qb = $this->getQueryBuilder()\n->addSelect('a')\n->innerJoin('content.author', 'a')\n->orderBy('content.modifiedAt', 'DESC');\n- if ($contentType) {\n- $qb->where('content.contentType = :ct')\n- ->setParameter('ct', $contentType->getSlug());\n+ if ($contentTypes->has('slug')) {\n+ $cts = [$contentTypes->get('slug')];\n+ } else {\n+ $cts = $contentTypes->pluck('slug')->all();\n}\n- $qb->orderBy('content.modifiedAt', 'DESC');\n+ $qb->where('content.contentType IN (:cts)')\n+ ->setParameter('cts', $cts);\n$qb->setMaxResults($amount);\n" } ]
PHP
MIT License
bolt/core
Don't show orphaned content on Dashboard if a ContentType was removed
95,144
14.03.2020 08:05:52
-3,600
5b6dc26d87a7db5a9736837162d949c8e37f9129
Move `doctrine-migrations-bundle` to dev-dependencies
[ { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"doctrine/doctrine-bundle\": \"^2.0\",\n\"doctrine/doctrine-cache-bundle\": \"^1.4\",\n\"doctrine/doctrine-fixtures-bundle\": \"^3.3\",\n- \"doctrine/doctrine-migrations-bundle\": \"^2.1\",\n\"doctrine/orm\": \"^2.7\",\n\"drupol/composer-packages\": \"^1.1\",\n\"embed/embed\": \"^3.4\",\n\"bolt/newswidget\": \"^1.1\",\n\"coduo/php-matcher\": \"^4.0\",\n\"dama/doctrine-test-bundle\": \"^6.2.0\",\n+ \"doctrine/doctrine-migrations-bundle\": \"^2.1\",\n\"lakion/mink-debug-extension\": \"^1.2\",\n\"php-http/httplug-pack\": \"^1.2\",\n\"php-translation/loco-adapter\": \"^0.10\",\n" }, { "change_type": "MODIFY", "old_path": "symfony.lock", "new_path": "symfony.lock", "diff": "\"fig/link-util\": {\n\"version\": \"1.1.0\"\n},\n+ \"friends-of-behat/mink-extension\": {\n+ \"version\": \"2.3.1\"\n+ },\n\"friendsofapi/localise.biz\": {\n\"version\": \"1.0.1\"\n},\n" } ]
PHP
MIT License
bolt/core
Move `doctrine-migrations-bundle` to dev-dependencies
95,144
14.03.2020 08:31:13
-3,600
e4560c32485e7bb882113531de3c21f2be60314e
Don't throw exception in listener for timedpublish
[ { "change_type": "MODIFY", "old_path": "src/Event/Subscriber/TimedPublishSubscriber.php", "new_path": "src/Event/Subscriber/TimedPublishSubscriber.php", "diff": "@@ -6,6 +6,7 @@ namespace Bolt\\Event\\Subscriber;\nuse Bolt\\Common\\Str;\nuse Carbon\\Carbon;\n+use Doctrine\\DBAL\\Exception\\TableNotFoundException;\nuse Doctrine\\ORM\\EntityManagerInterface;\nuse Symfony\\Component\\EventDispatcher\\EventSubscriberInterface;\nuse Symfony\\Component\\HttpKernel\\KernelEvents;\n@@ -34,14 +35,17 @@ class TimedPublishSubscriber implements EventSubscriberInterface\n$conn = $this->entityManager->getConnection();\n$now = (new Carbon())->tz('UTC');\n- // Publish timed Content records when 'publish_at' has passed.\n- // Note: Placeholders in DBAL don't work for tablenames.\n- $query = sprintf('update %scontent SET status = \"published\", published_at = :now WHERE status = \"timed\" AND published_at < :now', $this->prefix);\n- $conn->executeUpdate($query, [':now' => $now]);\n+ // Publish timed Content records when 'publish_at' has passed and Depublish published Content\n+ // records when 'depublish_at' has passed. Note: Placeholders in DBAL don't work for tablenames.\n+ $queryPublish = sprintf('update %scontent SET status = \"published\", published_at = :now WHERE status = \"timed\" AND published_at < :now', $this->prefix);\n+ $queryDepublish = sprintf('update %scontent SET status = \"held\", depublished_at = :now WHERE status = \"published\" AND depublished_at < :now', $this->prefix);\n- // Depublish published Content records when 'depublish_at' has passed.\n- $query = sprintf('update %scontent SET status = \"held\", depublished_at = :now WHERE status = \"published\" AND depublished_at < :now', $this->prefix);\n- $conn->executeUpdate($query, [':now' => $now]);\n+ try {\n+ $conn->executeUpdate($queryPublish, [':now' => $now]);\n+ $conn->executeUpdate($queryDepublish, [':now' => $now]);\n+ } catch (TableNotFoundException $e) {\n+ // Fail silently, output user-friendly exception elsewhere.\n+ }\n}\n/**\n" } ]
PHP
MIT License
bolt/core
Don't throw exception in listener for timedpublish
95,144
14.03.2020 10:37:48
-3,600
2d0f0a88a936050cf646bec0e1212f1815d6da05
Better handling if database/tables don't exist yet
[ { "change_type": "MODIFY", "old_path": "config/services.yaml", "new_path": "config/services.yaml", "diff": "@@ -21,6 +21,7 @@ services:\n$emailSender: '%app.notifications.email_sender%'\n$projectDir: '%kernel.project_dir%'\n$publicFolder: '%bolt.public_folder%'\n+ $tablePrefix: '%bolt.table_prefix%'\n# makes classes in src/ available to be used as services\n# this creates a service per class whose id is the fully-qualified class name\n@@ -41,7 +42,6 @@ services:\n$debug: '%kernel.debug%'\nBolt\\Doctrine\\TablePrefix:\n- arguments: [ \"%bolt.table_prefix%\" ]\ntags:\n- { name: doctrine.event_listener, event: loadClassMetadata, lazy: true }\n@@ -54,9 +54,6 @@ services:\ntags:\n- { name: doctrine.event_listener, event: loadClassMetadata }\n- Bolt\\Event\\Subscriber\\TimedPublishSubscriber:\n- arguments: [ \"%bolt.table_prefix%\" ]\n-\nBolt\\Extension\\RoutesLoader:\ntags: [routing.loader]\n" }, { "change_type": "MODIFY", "old_path": "src/Command/AddUserCommand.php", "new_path": "src/Command/AddUserCommand.php", "diff": "@@ -141,7 +141,7 @@ class AddUserCommand extends Command\nif ($password !== null) {\n$this->io->text(' > <info>Password</info>: ' . str_repeat('*', mb_strlen($password)));\n} else {\n- $passwordQuestion = new Question('Password', Str::generatePassword());\n+ $passwordQuestion = new Question('Password (input is hidden)', Str::generatePassword());\n$passwordQuestion->setHidden(true);\n$passwordQuestion->setValidator([$this->validator, 'validatePassword']);\n" }, { "change_type": "MODIFY", "old_path": "src/Command/InfoCommand.php", "new_path": "src/Command/InfoCommand.php", "diff": "@@ -58,9 +58,11 @@ HELP\n$connection = ! empty($platform['connection_status']) ? sprintf('- <comment>%s</comment>', $platform['connection_status']) : '';\n+ $tableExists = $this->doctrineVersion->tableContentExists() ? '' : sprintf('- <error>Tables not initialised</error>');\n+\n$io->listing([\nsprintf('Install type: <info>%s</info>', Version::installType()),\n- sprintf('Database: <info>%s %s</info> %s', $platform['driver_name'], $platform['server_version'], $connection),\n+ sprintf('Database: <info>%s %s</info> %s %s', $platform['driver_name'], $platform['server_version'], $connection, $tableExists),\nsprintf('PHP version: <info>%s</info>', PHP_VERSION),\nsprintf('Operating System: <info>%s</info> - <comment>%s</comment>', php_uname('s'), php_uname('r')),\n]);\n" }, { "change_type": "MODIFY", "old_path": "src/Command/SetupCommand.php", "new_path": "src/Command/SetupCommand.php", "diff": "@@ -4,6 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Command;\n+use Doctrine\\DBAL\\Connection;\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\ArrayInput;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\n@@ -15,6 +16,16 @@ class SetupCommand extends Command\n{\nprotected static $defaultName = 'bolt:setup';\n+ /** @var Connection */\n+ private $connection;\n+\n+ public function __construct(Connection $connection)\n+ {\n+ $this->connection = $connection;\n+\n+ parent::__construct();\n+ }\n+\nprotected function configure(): void\n{\n$this\n@@ -28,17 +39,21 @@ class SetupCommand extends Command\n$exitCode = 0;\n$io = new SymfonyStyle($input, $output);\n+ // Because SQLite breaks on `--if-not-exists`, we need to check for that here.\n+ // See: https://github.com/doctrine/DoctrineBundle/issues/542\n+ $options = ['-q' => true];\n+ if ($this->connection->getDatabasePlatform()->getName() !== 'sqlite') {\n+ $options[] = ['--if-not-exists' => true];\n+ }\n+\n$command = $this->getApplication()->find('doctrine:database:create');\n- $commandInput = new ArrayInput(['-q' => true]);\n- $exitCode += $command->run($commandInput, $output);\n+ $exitCode += $command->run(new ArrayInput($options), $output);\n$command = $this->getApplication()->find('doctrine:schema:create');\n- $commandInput = new ArrayInput([]);\n- $exitCode += $command->run($commandInput, $output);\n+ $exitCode += $command->run(new ArrayInput([]), $output);\n$command = $this->getApplication()->find('bolt:reset-secret');\n- $commandInput = new ArrayInput([]);\n- $exitCode += $command->run($commandInput, $output);\n+ $exitCode += $command->run(new ArrayInput([]), $output);\n$command = $this->getApplication()->find('bolt:add-user');\n$commandInput = new ArrayInput(['--admin' => true]);\n" }, { "change_type": "MODIFY", "old_path": "src/Doctrine/TablePrefix.php", "new_path": "src/Doctrine/TablePrefix.php", "diff": "@@ -10,11 +10,11 @@ use Doctrine\\ORM\\Mapping\\ClassMetadataInfo;\nclass TablePrefix\n{\n- private $prefix;\n+ private $tablePrefix;\n- public function __construct(string $prefix)\n+ public function __construct(string $tablePrefix)\n{\n- $this->prefix = Str::ensureEndsWith($prefix, '_');\n+ $this->tablePrefix = Str::ensureEndsWith($tablePrefix, '_');\n}\npublic function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void\n@@ -23,14 +23,14 @@ class TablePrefix\nif (! $classMetadata->isInheritanceTypeSingleTable() || $classMetadata->getName() === $classMetadata->rootEntityName) {\n$classMetadata->setPrimaryTable([\n- 'name' => $this->prefix . $classMetadata->getTableName(),\n+ 'name' => $this->tablePrefix . $classMetadata->getTableName(),\n]);\n}\nforeach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {\nif ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && $mapping['isOwningSide']) {\n$mappedTableName = $mapping['joinTable']['name'];\n- $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName;\n+ $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->tablePrefix . $mappedTableName;\n}\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Doctrine/Version.php", "new_path": "src/Doctrine/Version.php", "diff": "@@ -4,6 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Doctrine;\n+use Bolt\\Common\\Str;\nuse Doctrine\\DBAL\\Connection;\nuse Doctrine\\DBAL\\Driver\\PDOConnection;\n@@ -12,9 +13,13 @@ class Version\n/** @var Connection */\nprivate $connection;\n- public function __construct(Connection $connection)\n+ /** @var string */\n+ private $tablePrefix;\n+\n+ public function __construct(Connection $connection, string $tablePrefix)\n{\n$this->connection = $connection;\n+ $this->tablePrefix = Str::ensureEndsWith($tablePrefix, '_');\n}\npublic function getPlatform(): array\n@@ -37,4 +42,15 @@ class Version\n'server_version' => $wrapped->getAttribute(\\PDO::ATTR_SERVER_VERSION),\n];\n}\n+\n+ public function tableContentExists(): bool\n+ {\n+ try {\n+ $this->connection->executeQuery(\"SELECT 1 FROM \" . $this->tablePrefix . \"content LIMIT 1; \");\n+ } catch (\\Exception $e) {\n+ return false;\n+ }\n+\n+ return true;\n+ }\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Event/Subscriber/TimedPublishSubscriber.php", "new_path": "src/Event/Subscriber/TimedPublishSubscriber.php", "diff": "@@ -19,12 +19,12 @@ class TimedPublishSubscriber implements EventSubscriberInterface\nprivate $entityManager;\n/** @var string */\n- private $prefix;\n+ private $tablePrefix;\n- public function __construct(string $prefix, EntityManagerInterface $entityManager)\n+ public function __construct(string $tablePrefix, EntityManagerInterface $entityManager)\n{\n$this->entityManager = $entityManager;\n- $this->prefix = Str::ensureEndsWith($prefix, '_');\n+ $this->tablePrefix = Str::ensureEndsWith($tablePrefix, '_');\n}\n/**\n@@ -37,8 +37,8 @@ class TimedPublishSubscriber implements EventSubscriberInterface\n// Publish timed Content records when 'publish_at' has passed and Depublish published Content\n// records when 'depublish_at' has passed. Note: Placeholders in DBAL don't work for tablenames.\n- $queryPublish = sprintf('update %scontent SET status = \"published\", published_at = :now WHERE status = \"timed\" AND published_at < :now', $this->prefix);\n- $queryDepublish = sprintf('update %scontent SET status = \"held\", depublished_at = :now WHERE status = \"published\" AND depublished_at < :now', $this->prefix);\n+ $queryPublish = sprintf('update %scontent SET status = \"published\", published_at = :now WHERE status = \"timed\" AND published_at < :now', $this->tablePrefix);\n+ $queryDepublish = sprintf('update %scontent SET status = \"held\", depublished_at = :now WHERE status = \"published\" AND depublished_at < :now', $this->tablePrefix);\ntry {\n$conn->executeUpdate($queryPublish, [':now' => $now]);\n" } ]
PHP
MIT License
bolt/core
Better handling if database/tables don't exist yet
95,144
14.03.2020 11:48:02
-3,600
ac3fbb4b2485072e158ffe3a45bed7eccca9ed0d
Update Sirius Uploader, get rid of raw `$_FILES`
[ { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"scienta/doctrine-json-functions\": \"^4.1\",\n\"sensio/framework-extra-bundle\": \"^5.5\",\n\"sensiolabs/security-checker\": \"^6.0\",\n- \"siriusphp/upload\": \"^2.1\",\n+ \"siriusphp/upload\": \"^3.0\",\n\"symfony/asset\": \"^4.4\",\n\"symfony/console\": \"^4.4\",\n\"symfony/debug-bundle\": \"^4.4\",\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/Async/UploadController.php", "new_path": "src/Controller/Backend/Async/UploadController.php", "diff": "@@ -88,10 +88,8 @@ class UploadController implements AsyncZoneInterface\nreturn $this->sanitiseFilename($name);\n});\n- // @todo Refactor file upload handler. See issue https://github.com/bolt/core/issues/402\n-\n/** @var File $result */\n- $result = $uploadHandler->process($_FILES);\n+ $result = $uploadHandler->process($request->files->all());\nif ($result->isValid()) {\ntry {\n" } ]
PHP
MIT License
bolt/core
Update Sirius Uploader, get rid of raw `$_FILES`
95,144
14.03.2020 12:06:37
-3,600
0ba6e3ef2308d478ed6e53c5ce2f62f896610392
Default param for prefix
[ { "change_type": "MODIFY", "old_path": "src/Doctrine/Version.php", "new_path": "src/Doctrine/Version.php", "diff": "@@ -16,7 +16,7 @@ class Version\n/** @var string */\nprivate $tablePrefix;\n- public function __construct(Connection $connection, string $tablePrefix)\n+ public function __construct(Connection $connection, string $tablePrefix = 'bolt')\n{\n$this->connection = $connection;\n$this->tablePrefix = Str::ensureEndsWith($tablePrefix, '_');\n" } ]
PHP
MIT License
bolt/core
Default param for prefix
95,144
14.03.2020 18:41:39
-3,600
d83c02d944bfbe0146a80ef245bae7b629764309
New thumbnailer controller
[ { "change_type": "MODIFY", "old_path": "config/bolt/config.yaml", "new_path": "config/bolt/config.yaml", "diff": "@@ -124,6 +124,25 @@ search_results_records: 10\n# for each content type.\nrecords_per_page: 8\n+\n+# Default settings for thumbnails.\n+#\n+# quality: Quality should be between 0 (horrible, small file) and 100 (best, huge file).\n+# fit: One of either none, crop (= crop-center), crop-top-left, crop-top, crop-top-right, crop-left, crop-right, crop-bottom-left, crop-bottom or crop-bottom-right.\n+# allow_upscale: Determines whether small images will be enlarged to fit\n+# the requested dimensions.\n+# save_files: Save files in the thumbs/ folder, so subsequent requests will serve file directly. Great for performance\n+#\n+# Note: If you change these values, you might need to clear the cache before\n+# they show up.\n+thumbnails:\n+ default_thumbnail: [ 160, 120 ]\n+ default_image: [ 1000, 750 ]\n+ quality: 80\n+ cropping: crop\n+ save_files: true\n+ allow_upscale: false\n+\n# Define the HTML tags and attributes that are allowed in cleaned HTML. This\n# is used for sanitizing HTML, to make sure there are no undesirable elements\n# left in the content that is shown to users. For example, tags like `<script>`\n" }, { "change_type": "MODIFY", "old_path": "public/.htaccess", "new_path": "public/.htaccess", "diff": "@@ -54,6 +54,7 @@ DirectoryIndex index.php\nRewriteRule ^ - [L]\n# Rewrite all other queries to the front controller.\n+ RewriteCond %{REQUEST_URI} !=/favicon.ico\nRewriteRule ^ %{ENV:BASE}/index.php [L]\n</IfModule>\n" }, { "change_type": "ADD", "old_path": "public/favicon.ico", "new_path": "public/favicon.ico", "diff": "Binary files /dev/null and b/public/favicon.ico differ\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/PathResolver.php", "new_path": "src/Configuration/PathResolver.php", "diff": "@@ -39,6 +39,7 @@ class PathResolver\n'web' => '%site%/' . $public,\n'files' => '%web%/files',\n'themes' => '%web%/theme',\n+ 'thumbs' => '%web%/thumbs',\n'bolt_assets' => '%web%/bolt-public',\n];\n}\n" } ]
PHP
MIT License
bolt/core
New thumbnailer controller
95,144
14.03.2020 19:09:13
-3,600
c3eecbaa3b6fd004671cc20dbdf1882de9764951
Working on thumbnails.
[ { "change_type": "MODIFY", "old_path": ".gitignore", "new_path": ".gitignore", "diff": "@@ -3,6 +3,7 @@ composer.phar\n### Built Assets and uploads ###\n/public/assets/\n/public/files/*\n+/public/thumbs/*\n### NPM and frontend assets building cruft\nassets/vendor/\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/ImageController.php", "new_path": "src/Controller/ImageController.php", "diff": "@@ -6,8 +6,8 @@ namespace Bolt\\Controller;\nuse Bolt\\Configuration\\Config;\nuse League\\Glide\\Responses\\SymfonyResponseFactory;\n-use League\\Glide\\ServerFactory;\nuse League\\Glide\\Server;\n+use League\\Glide\\ServerFactory;\nuse Symfony\\Component\\Filesystem\\Filesystem;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\n@@ -62,7 +62,7 @@ class ImageController\nreturn isset($this->parameters['location']) ? $this->parameters['location'] : $this->request->query->get('location', 'files');\n}\n- private function getPath(string $path = null, bool $absolute = true, $additional = null): string\n+ private function getPath(?string $path = null, bool $absolute = true, $additional = null): string\n{\nif (! $path) {\n$path = $this->getLocation();\n@@ -108,7 +108,10 @@ class ImageController\nif (pathinfo($filename)['extension'] === 'svg') {\n$filepath = sprintf('%s%s%s', $this->getPath(), DIRECTORY_SEPARATOR, $filename);\n- return new Response(file_get_contents($filepath));\n+ $response = new Response(file_get_contents($filepath));\n+ $response->headers->set('Content-Type', 'image/svg+xml');\n+\n+ return $response;\n}\nif ($this->request->query->has('path')) {\n@@ -128,11 +131,11 @@ class ImageController\n];\nforeach ($raw as $rawParameter) {\n- if (strpos($rawParameter, '=') !== false) {\n+ if (mb_strpos($rawParameter, '=') !== false) {\n[$key, $value] = explode('=', $rawParameter);\n// @todo Add more thumbnailing options here, perhaps.\n- if (in_array($key, $this->thumbnailOptions)) {\n+ if (in_array($key, $this->thumbnailOptions, true)) {\n$this->parameters[$key] = $value;\n}\n}\n" } ]
PHP
MIT License
bolt/core
Working on thumbnails.
95,144
15.03.2020 08:31:51
-3,600
763561eb12f14c5a9cffd0ef43185789c96a4802
Add `cache:thumbs` command to clear thumbnail cache
[ { "change_type": "ADD", "old_path": null, "new_path": "src/Command/ClearThumbnailCacheCommand.php", "diff": "+<?php\n+\n+declare(strict_types=1);\n+\n+namespace Bolt\\Command;\n+\n+use Bolt\\Utils\\ThumbnailCacheClearer;\n+use Symfony\\Component\\Console\\Command\\Command;\n+use Symfony\\Component\\Console\\Input\\InputInterface;\n+use Symfony\\Component\\Console\\Output\\OutputInterface;\n+use Symfony\\Component\\Console\\Style\\SymfonyStyle;\n+\n+class ClearThumbnailCacheCommand extends Command\n+{\n+ protected static $defaultName = 'cache:thumbs';\n+\n+ /** @var ThumbnailCacheClearer */\n+ private $thumbnailCacheClearer;\n+\n+ public function __construct(ThumbnailCacheClearer $thumbnailCacheClearer)\n+ {\n+ $this->thumbnailCacheClearer = $thumbnailCacheClearer;\n+\n+ parent::__construct();\n+ }\n+\n+ /**\n+ * {@inheritdoc}\n+ */\n+ protected function configure(): void\n+ {\n+ $this\n+ ->setDescription('Clear Bolt\\'s thumbnail cache folder')\n+ ->setHelp(\n+ <<<'HELP'\n+The <info>%command.name%</info> command clears the `thumbs/` folder, that's used to efficiently store and serve thumbnail images.\n+HELP\n+ );\n+ }\n+\n+ /**\n+ * This method is executed after initialize(). It usually contains the logic\n+ * to execute to complete this command task.\n+ */\n+ protected function execute(InputInterface $input, OutputInterface $output)\n+ {\n+ $io = new SymfonyStyle($input, $output);\n+\n+ $io->text('// Clearing the Bolt thumbnail cache folder');\n+\n+ $success = $this->thumbnailCacheClearer->run();\n+\n+ if ($success) {\n+ $io->success('Thumbnail cache folder cleared successfully.');\n+ } else {\n+ $io->warning('Not all files in the Thumbnail cache could be cleared successfully. Remove them manually');\n+ }\n+\n+ return null;\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Utils/ThumbnailCacheClearer.php", "diff": "+<?php\n+\n+declare(strict_types=1);\n+\n+namespace Bolt\\Utils;\n+\n+use Bolt\\Configuration\\Config;\n+use Symfony\\Component\\Filesystem\\Exception\\IOException;\n+use Symfony\\Component\\Filesystem\\Filesystem;\n+use Symfony\\Component\\Finder\\Finder;\n+\n+class ThumbnailCacheClearer\n+{\n+ /** @var Config */\n+ private $config;\n+\n+ public function __construct(Config $config)\n+ {\n+ $this->config = $config;\n+ }\n+\n+ public function run(): bool\n+ {\n+ $path = $this->config->getPath('thumbs');\n+\n+ $finder = new Finder();\n+ $filesystem = new Filesystem();\n+\n+ $finder->directories()->in($path)->depth(0);\n+\n+ $success = true;\n+\n+ foreach ($finder as $folder) {\n+ $absPath = $folder->getRealPath();\n+\n+ try {\n+ $filesystem->remove($absPath);\n+ } catch (IOException $e) {\n+ $success = false;\n+ }\n+ }\n+\n+ return $success;\n+ }\n+}\n" } ]
PHP
MIT License
bolt/core
Add `cache:thumbs` command to clear thumbnail cache
95,144
15.03.2020 08:49:41
-3,600
006de3a8d88b6a58946b5638803ebe5eb62b1533
Make it a bit more resilient
[ { "change_type": "MODIFY", "old_path": "src/Canonical.php", "new_path": "src/Canonical.php", "diff": "@@ -8,6 +8,7 @@ use Bolt\\Configuration\\Config;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\RequestStack;\nuse Symfony\\Component\\Routing\\Exception\\InvalidParameterException;\n+use Symfony\\Component\\Routing\\Exception\\MissingMandatoryParametersException;\nuse Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface;\nclass Canonical\n@@ -156,7 +157,7 @@ class Canonical\n$route,\n$params\n);\n- } catch (InvalidParameterException $e) {\n+ } catch (InvalidParameterException | MissingMandatoryParametersException $e) {\n// Just use the current URL /shrug\n$this->request->getUri();\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/ImageController.php", "new_path": "src/Controller/ImageController.php", "diff": "@@ -4,6 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Controller;\n+use Bolt\\Common\\Str;\nuse Bolt\\Configuration\\Config;\nuse League\\Glide\\Responses\\SymfonyResponseFactory;\nuse League\\Glide\\Server;\n@@ -11,6 +12,7 @@ use League\\Glide\\ServerFactory;\nuse Symfony\\Component\\Filesystem\\Filesystem;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\n+use Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException;\nuse Symfony\\Component\\Routing\\Annotation\\Route;\nclass ImageController\n@@ -39,6 +41,10 @@ class ImageController\n*/\npublic function thumbnail(string $paramString, string $filename, Request $request)\n{\n+ if (! $this->isImage($filename)) {\n+ throw new NotFoundHttpException('Thumbnail not found');\n+ }\n+\n$this->request = $request;\n$this->parseParameters($paramString);\n@@ -87,7 +93,7 @@ class ImageController\nprivate function buildImage(string $filename): string\n{\n// In case we're trying to \"thumbnail\" an svg, just return the whole thing.\n- if (pathinfo($filename)['extension'] === 'svg') {\n+ if ($this->isSvg($filename)) {\n$filepath = sprintf('%s%s%s', $this->getPath(), DIRECTORY_SEPARATOR, $filename);\nreturn file_get_contents($filepath);\n@@ -105,7 +111,7 @@ class ImageController\nprivate function buildResponse(string $filename): Response\n{\n// In case we're trying to \"thumbnail\" an svg, just return the whole thing.\n- if (pathinfo($filename)['extension'] === 'svg') {\n+ if ($this->isSvg($filename)) {\n$filepath = sprintf('%s%s%s', $this->getPath(), DIRECTORY_SEPARATOR, $filename);\n$response = new Response(file_get_contents($filepath));\n@@ -141,4 +147,23 @@ class ImageController\n}\n}\n}\n+\n+ private function isSvg(string $filename): bool\n+ {\n+ $pathinfo = pathinfo($filename);\n+\n+\n+ return (array_key_exists('extension', $pathinfo) && $pathinfo['extension'] === 'svg');\n+ }\n+\n+ private function isImage(string $filename): bool\n+ {\n+ $pathinfo = pathinfo($filename);\n+\n+ $imageExtensions = ['gif', 'png', 'jpg', 'jpeg', 'svg', 'webp'];\n+\n+ return (array_key_exists('extension', $pathinfo) && in_array($pathinfo['extension'], $imageExtensions));\n+ }\n+\n+\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/MediaFactory.php", "new_path": "src/Factory/MediaFactory.php", "diff": "@@ -106,7 +106,7 @@ class MediaFactory\nprivate function isImage(Media $media): bool\n{\n- return in_array($media->getType(), ['gif', 'png', 'jpg', 'jpeg', 'svg'], true);\n+ return in_array($media->getType(), ['gif', 'png', 'jpg', 'jpeg', 'svg', 'webp'], true);\n}\npublic function createFromFilename(string $locationName, string $path, string $filename): Media\n" } ]
PHP
MIT License
bolt/core
Make it a bit more resilient
95,144
15.03.2020 09:39:45
-3,600
2f9c1ec9e648633fba58c1d7c80ca8bdd0133a1c
Fixing Image preview in editor
[ { "change_type": "MODIFY", "old_path": "src/Utils/ThumbnailHelper.php", "new_path": "src/Utils/ThumbnailHelper.php", "diff": "@@ -43,8 +43,12 @@ class ThumbnailHelper\nreturn $paramString;\n}\n- public function path(string $filename, ?int $width = null, ?int $height = null, ?string $location = null, ?string $path = null, ?string $fit = null): string\n+ public function path(?string $filename = null, ?int $width = null, ?int $height = null, ?string $location = null, ?string $path = null, ?string $fit = null): string\n{\n+ if (! $filename) {\n+ return '/assets/images/placeholder.png';\n+ }\n+\n$paramString = $this->parameters($width, $height, $location, $path, $fit);\n$filename = Str::ensureStartsWith($filename, '/');\n" } ]
PHP
MIT License
bolt/core
Fixing Image preview in editor
95,144
15.03.2020 15:42:59
-3,600
da2f524985490c78bf37572278d8a325a91ea1dd
Make ordering in `{% setcontent %}` more robust
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/ContentTypesParser.php", "new_path": "src/Configuration/Parser/ContentTypesParser.php", "diff": "@@ -159,6 +159,13 @@ class ContentTypesParser extends BaseParser\n$contentType['sort'] = $this->determineSort($contentType);\n+ // Make sure title_format is set\n+ if (isset($contentType['title_format'])) {\n+ $contentType['title_format'] = (array) $contentType['title_format'];\n+ } else {\n+ $contentType['title_format'] = (array) $contentType['fields']['slug']['uses'];\n+ }\n+\n// Make sure taxonomy is an array.\nif (isset($contentType['taxonomy'])) {\n$contentType['taxonomy'] = (array) $contentType['taxonomy'];\n" }, { "change_type": "MODIFY", "old_path": "src/Storage/Directive/OrderDirective.php", "new_path": "src/Storage/Directive/OrderDirective.php", "diff": "@@ -13,15 +13,6 @@ use Bolt\\Storage\\QueryInterface;\n*/\nclass OrderDirective\n{\n- private $coreFields = [\n- 'id',\n- 'createdAt',\n- 'modifiedAt',\n- 'publishedAt',\n- 'depublishedAt',\n- 'status',\n- ];\n-\npublic function __invoke(QueryInterface $query, string $order): void\n{\nif ($order === '') {\n@@ -36,7 +27,7 @@ class OrderDirective\nforeach ($separatedOrders as $order) {\n[ $order, $direction ] = $this->createSortBy($order);\n- if (in_array($order, $this->coreFields, true)) {\n+ if (in_array($order, $query->getCoreFields(), true)) {\n$query->getQueryBuilder()->addOrderBy('content.' . $order, $direction);\n} elseif ($order === 'author') {\n$query\n@@ -44,6 +35,9 @@ class OrderDirective\n->leftJoin('content.author', 'user')\n->addOrderBy('user.username', $direction);\n} else {\n+ if (! $this->isActualField($query, $order)) {\n+ dump(\"A query with ordering on a Field (`${order}`) that's not defined, will yield unexpected results. Update your `{% setcontent %}`-statement\");\n+ }\n$fieldsAlias = 'fields_order_' . $query->getIndex();\n$fieldAlias = 'order_' . $query->getIndex();\n$translationsAlias = 'translations_order_' . $query->getIndex();\n@@ -94,4 +88,11 @@ class OrderDirective\n{\nreturn mb_strpos($order, ',') !== false;\n}\n+\n+ protected function isActualField(QueryInterface $query, string $name): bool\n+ {\n+ $contentType = $query->getConfig()->get('contenttypes/' . $query->getContentType());\n+\n+ return in_array($name, $contentType->get('fields')->keys()->all(), true);\n+ }\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Storage/QueryInterface.php", "new_path": "src/Storage/QueryInterface.php", "diff": "@@ -4,6 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Storage;\n+use Bolt\\Configuration\\Config;\nuse Doctrine\\ORM\\QueryBuilder;\n/**\n@@ -44,4 +45,8 @@ interface QueryInterface\n* Sets the value of a parameter by key name.\n*/\npublic function setParameter(string $key, $value): void;\n+\n+ public function getCoreFields(): array;\n+\n+ public function getConfig(): Config;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Storage/SelectQuery.php", "new_path": "src/Storage/SelectQuery.php", "diff": "@@ -4,6 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Storage;\n+use Bolt\\Configuration\\Config;\nuse Bolt\\Doctrine\\JsonHelper;\nuse Doctrine\\ORM\\Query\\Expr\\Base;\nuse Doctrine\\ORM\\Query\\ParameterTypeInferer;\n@@ -67,13 +68,17 @@ class SelectQuery implements QueryInterface\n/** @var array */\nprivate $fieldJoins = [];\n+ /** @var Config */\n+ private $config;\n+\n/**\n* Constructor.\n*/\n- public function __construct(?QueryBuilder $qb = null, QueryParameterParser $parser)\n+ public function __construct(?QueryBuilder $qb = null, QueryParameterParser $parser, Config $config)\n{\n$this->qb = $qb;\n$this->parser = $parser;\n+ $this->config = $config;\n}\n/**\n@@ -381,4 +386,14 @@ class SelectQuery implements QueryInterface\nreturn $this->getIndex();\n}\n+\n+ public function getCoreFields(): array\n+ {\n+ return $this->coreFields;\n+ }\n+\n+ public function getConfig(): Config\n+ {\n+ return $this->config;\n+ }\n}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/listing.html.twig", "new_path": "templates/content/listing.html.twig", "diff": ":csrftoken=\"{{ csrf_token('batch')|json_encode }}\"\n></listing-select-box>\n+ {% set titleField = contentType.title_format|first %}\n+ {% set titleLabel = contentType.fields[titleField].label %}\n+\n{% set filterOptions = {\n- 'id': \"Id\", 'title': 'Title', 'author': 'Author', 'status': 'Status', 'createdAt': 'Created date',\n+ 'id': \"Id\", (titleField): titleLabel, 'author': 'Author', 'status': 'Status', 'createdAt': 'Created date',\n'modifiedAt': 'Modified date', 'publishedAt': 'Published date', 'depublishedAt': 'Depublished date'\n} %}\n" } ]
PHP
MIT License
bolt/core
Make ordering in `{% setcontent %}` more robust
95,144
15.03.2020 16:05:30
-3,600
389e191bf227b2f5e2f900db839b4c72a1ad62d2
Tweak, fix test.
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/ContentTypesParser.php", "new_path": "src/Configuration/Parser/ContentTypesParser.php", "diff": "@@ -162,8 +162,10 @@ class ContentTypesParser extends BaseParser\n// Make sure title_format is set\nif (isset($contentType['title_format'])) {\n$contentType['title_format'] = (array) $contentType['title_format'];\n- } else {\n+ } elseif (isset($contentType['fields']['slug']['uses'])) {\n$contentType['title_format'] = (array) $contentType['fields']['slug']['uses'];\n+ } else {\n+ $contentType['title_format'] = (array) key($contentType['fields']);\n}\n// Make sure taxonomy is an array.\n" }, { "change_type": "MODIFY", "old_path": "tests/php/Configuration/Parser/ContentTypesParserTest.php", "new_path": "tests/php/Configuration/Parser/ContentTypesParserTest.php", "diff": "@@ -15,7 +15,7 @@ class ContentTypesParserTest extends ParserTestBase\n{\npublic const NUMBER_OF_CONTENT_TYPES_IN_MINIMAL_FILE = 2;\n- public const AMOUNT_OF_ATTRIBUTES_IN_CONTENT_TYPE = 22;\n+ public const AMOUNT_OF_ATTRIBUTES_IN_CONTENT_TYPE = 23;\npublic const AMOUNT_OF_ATTRIBUTES_IN_FIELD = 22;\n" } ]
PHP
MIT License
bolt/core
Tweak, fix test.
95,144
15.03.2020 19:26:03
-3,600
d85f6221b5cac9dfc95f9cc1eb7cac89daea4a51
Split off `get_definition` from `get_content` for Serializer purposes
[ { "change_type": "MODIFY", "old_path": "src/Entity/Content.php", "new_path": "src/Entity/Content.php", "diff": "@@ -193,7 +193,7 @@ class Content\n}\n/**\n- * @Groups(\"get_content\")\n+ * @Groups(\"get_definition\")\n*/\npublic function getDefinition(): ?ContentType\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/JsonExtension.php", "new_path": "src/Twig/JsonExtension.php", "diff": "@@ -15,6 +15,10 @@ class JsonExtension extends AbstractExtension\n{\nprivate const SERIALIZE_GROUP = 'get_content';\n+ private const SERIALIZE_GROUP_DEFINITION = 'get_definition';\n+\n+ private $includeDefinition = true;\n+\n/** @var NormalizerInterface */\nprivate $normalizer;\n@@ -44,9 +48,11 @@ class JsonExtension extends AbstractExtension\n];\n}\n- public function jsonRecords($records): string\n+ public function jsonRecords($records, ?bool $includeDefinition = true, int $options = 0): string\n{\n- return Json::json_encode($this->normalizeRecords($records));\n+ $this->includeDefinition = $includeDefinition;\n+\n+ return Json::json_encode($this->normalizeRecords($records), $options);\n}\n/**\n@@ -69,10 +75,16 @@ class JsonExtension extends AbstractExtension\nprivate function contentToArray(Content $content): array\n{\n+ $group = [self::SERIALIZE_GROUP];\n+\n+ if ($this->includeDefinition) {\n+ $group[] = self::SERIALIZE_GROUP_DEFINITION;\n+ }\n+\n// we do it that way because in current API Platform version a Resource\n// can't implement \\JsonSerializable\nreturn $this->normalizer->normalize($content, null, [\n- 'group' => [self::SERIALIZE_GROUP],\n+ 'groups' => $group,\n]);\n}\n" } ]
PHP
MIT License
bolt/core
Split off `get_definition` from `get_content` for Serializer purposes
95,144
15.03.2020 19:38:56
-3,600
1b5fbf89287949b8618bdb37d25af17dbbd81127
Include "get_definition" in API
[ { "change_type": "MODIFY", "old_path": "src/Entity/Content.php", "new_path": "src/Entity/Content.php", "diff": "@@ -20,7 +20,7 @@ use Tightenco\\Collect\\Support\\Collection as LaravelCollection;\n/**\n* @ApiResource(\n- * normalizationContext={\"groups\"={\"get_content\"}},\n+ * normalizationContext={\"groups\"={\"get_content\",\"get_definition\"}},\n* collectionOperations={\"get\"},\n* itemOperations={\"get\"}\n* )\n" } ]
PHP
MIT License
bolt/core
Include "get_definition" in API
95,144
17.03.2020 06:50:17
-3,600
4afc41d9efec8f0ed4f657ba183882c1e38a3f79
Catch all exceptions / throwables in TimedPublishListener
[ { "change_type": "MODIFY", "old_path": "src/Event/Subscriber/TimedPublishSubscriber.php", "new_path": "src/Event/Subscriber/TimedPublishSubscriber.php", "diff": "@@ -6,7 +6,6 @@ namespace Bolt\\Event\\Subscriber;\nuse Bolt\\Common\\Str;\nuse Carbon\\Carbon;\n-use Doctrine\\DBAL\\Exception\\TableNotFoundException;\nuse Doctrine\\ORM\\EntityManagerInterface;\nuse Symfony\\Component\\EventDispatcher\\EventSubscriberInterface;\nuse Symfony\\Component\\HttpKernel\\KernelEvents;\n@@ -43,7 +42,7 @@ class TimedPublishSubscriber implements EventSubscriberInterface\ntry {\n$conn->executeUpdate($queryPublish, [':now' => $now]);\n$conn->executeUpdate($queryDepublish, [':now' => $now]);\n- } catch (TableNotFoundException $e) {\n+ } catch (\\Throwable $e) {\n// Fail silently, output user-friendly exception elsewhere.\n}\n}\n" } ]
PHP
MIT License
bolt/core
Catch all exceptions / throwables in TimedPublishListener
95,144
17.03.2020 06:54:51
-3,600
31f06f285141c934909530eb996b0394d528f859
Don't break when trying to write thumbnails to non-writable folder
[ { "change_type": "MODIFY", "old_path": "src/Controller/ImageController.php", "new_path": "src/Controller/ImageController.php", "diff": "@@ -85,8 +85,13 @@ class ImageController\n$filePath = sprintf('%s%s%s%s%s', $this->getPath('thumbs'), DIRECTORY_SEPARATOR, $paramString, DIRECTORY_SEPARATOR, $filename);\n$filesystem = new Filesystem();\n+\n+ try {\n$filesystem->mkdir(dirname($filePath));\n$filesystem->dumpFile($filePath, $this->buildImage($filename));\n+ } catch (\\Throwable $e) {\n+ // Fail silently, output user-friendly exception elsewhere.\n+ }\n}\nprivate function buildImage(string $filename): string\n" } ]
PHP
MIT License
bolt/core
Don't break when trying to write thumbnails to non-writable folder
95,144
17.03.2020 07:47:51
-3,600
14bed11718be0da9f949a88937438d6543fcbd85
Exclude phpstan 0.12.15
[ { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"white-october/pagerfanta-bundle\": \"^1.3\"\n},\n\"conflict\": {\n- \"symfony/symfony\": \"*\"\n+ \"symfony/symfony\": \"*\",\n+ \"phpstan/phpstan\": \"0.12.15\"\n},\n\"require-dev\": {\n\"ext-curl\": \"*\",\n" } ]
PHP
MIT License
bolt/core
Exclude phpstan 0.12.15
95,144
17.03.2020 17:16:32
-3,600
9f5ab26feb5381b6238e1926c07f20d19f2e341a
And, PHPstan is update already
[ { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"white-october/pagerfanta-bundle\": \"^1.3\"\n},\n\"conflict\": {\n- \"symfony/symfony\": \"*\",\n- \"phpstan/phpstan\": \"0.12.15\"\n+ \"symfony/symfony\": \"*\"\n},\n\"require-dev\": {\n\"ext-curl\": \"*\",\n" } ]
PHP
MIT License
bolt/core
And, PHPstan is update already
95,144
17.03.2020 21:02:00
-3,600
590c7e81892426086440933ef511867272e0a5af
Sorting correctly for MySQL
[ { "change_type": "MODIFY", "old_path": "src/Controller/Frontend/ListingController.php", "new_path": "src/Controller/Frontend/ListingController.php", "diff": "@@ -44,8 +44,9 @@ class ListingController extends TwigAwareController implements FrontendZoneInter\n$contentType = ContentType::factory($contentTypeSlug, $this->config->get('contenttypes'));\n$page = (int) $request->query->get('page', 1);\n$amountPerPage = $contentType->get('listing_records');\n+ $order = $contentType->get('sort');\n- $records = $this->query->getContent($contentTypeSlug, ['status' => 'published'])\n+ $records = $this->query->getContent($contentTypeSlug, ['status' => 'published', 'order' => $order])\n->setMaxPerPage($amountPerPage)\n->setCurrentPage($page);\n" }, { "change_type": "MODIFY", "old_path": "src/Storage/Directive/OrderDirective.php", "new_path": "src/Storage/Directive/OrderDirective.php", "diff": "@@ -41,12 +41,15 @@ class OrderDirective\n$fieldsAlias = 'fields_order_' . $query->getIndex();\n$fieldAlias = 'order_' . $query->getIndex();\n$translationsAlias = 'translations_order_' . $query->getIndex();\n+\n+ // Note the `lower()` in the `addOrderBy()`. It is essential to sorting the\n+ // results correctly. See also https://github.com/bolt/core/issues/1190\n$query\n->getQueryBuilder()\n->leftJoin('content.fields', $fieldsAlias)\n->leftJoin($fieldsAlias . '.translations', $translationsAlias)\n->andWhere($fieldsAlias . '.name = :' . $fieldAlias)\n- ->addOrderBy($translationsAlias . '.value', $direction)\n+ ->addOrderBy('lower('.$translationsAlias . '.value)', $direction)\n->setParameter($fieldAlias, $order);\n$query->incrementIndex();\n" } ]
PHP
MIT License
bolt/core
Sorting correctly for MySQL
95,144
18.03.2020 06:46:28
-3,600
f8300287e9cb6fdf44433195aa0dcd43f225e8d3
Set permissions on created files correctly (as configured)
[ { "change_type": "MODIFY", "old_path": "src/Command/CopyAssetsCommand.php", "new_path": "src/Command/CopyAssetsCommand.php", "diff": "@@ -4,6 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Command;\n+use Bolt\\Configuration\\Config;\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\n@@ -22,12 +23,16 @@ class CopyAssetsCommand extends Command\n/** @var string */\nprivate $publicDirectory;\n- public function __construct(Filesystem $filesystem, string $publicFolder, string $projectDir)\n+ /** @var Config */\n+ private $config;\n+\n+ public function __construct(Filesystem $filesystem, string $publicFolder, string $projectDir, Config $config)\n{\nparent::__construct();\n$this->filesystem = $filesystem;\n$this->publicDirectory = $projectDir . '/' . $publicFolder;\n+ $this->config = $config;\n}\nprotected function configure(): void\n@@ -98,7 +103,8 @@ class CopyAssetsCommand extends Command\n*/\nprivate function hardCopy(string $originDir, string $targetDir): void\n{\n- $this->filesystem->mkdir($targetDir, 0777);\n+ $mode = $this->config->get('general/filepermissions/folders', 0774);\n+ $this->filesystem->mkdir($targetDir, $mode);\n// We use a custom iterator to ignore VCS files\n$this->filesystem->mirror($originDir, $targetDir, Finder::create()->ignoreDotFiles(false)->in($originDir));\n" }, { "change_type": "MODIFY", "old_path": "src/Command/CopyThemesCommand.php", "new_path": "src/Command/CopyThemesCommand.php", "diff": "@@ -4,6 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Command;\n+use Bolt\\Configuration\\Config;\nuse Bolt\\Version;\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\n@@ -23,12 +24,16 @@ class CopyThemesCommand extends Command\n/** @var string */\nprivate $publicDirectory;\n- public function __construct(Filesystem $filesystem, string $publicFolder, string $projectDir)\n+ /** @var Config */\n+ private $config;\n+\n+ public function __construct(Filesystem $filesystem, string $publicFolder, string $projectDir, Config $config)\n{\nparent::__construct();\n$this->filesystem = $filesystem;\n$this->publicDirectory = $projectDir . '/' . $publicFolder;\n+ $this->config = $config;\n}\nprotected function configure(): void\n@@ -101,7 +106,8 @@ class CopyThemesCommand extends Command\n*/\nprivate function hardCopy(string $originDir, string $targetDir): void\n{\n- $this->filesystem->mkdir($targetDir, 0777);\n+ $mode = $this->config->get('general/filepermissions/folders', 0774);\n+ $this->filesystem->mkdir($targetDir, $mode);\n// We use a custom iterator to ignore VCS files\n$this->filesystem->mirror($originDir, $targetDir, Finder::create()->ignoreDotFiles(false)->in($originDir));\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/ImageController.php", "new_path": "src/Controller/ImageController.php", "diff": "@@ -82,11 +82,15 @@ class ImageController\nreturn;\n}\n+ $filesystem = new Filesystem();\n+\n$filePath = sprintf('%s%s%s%s%s', $this->getPath('thumbs'), DIRECTORY_SEPARATOR, $paramString, DIRECTORY_SEPARATOR, $filename);\n+ $fileMode = $this->config->get('general/filepermissions/folders', 0774);\n+ $folderMode = $this->config->get('general/filepermissions/files', 0664);\n- $filesystem = new Filesystem();\n- $filesystem->mkdir(dirname($filePath));\n+ $filesystem->mkdir(dirname($filePath), $fileMode);\n$filesystem->dumpFile($filePath, $this->buildImage($filename));\n+ $filesystem->chmod($filePath, $folderMode);\n}\nprivate function buildImage(string $filename): string\n" } ]
PHP
MIT License
bolt/core
Set permissions on created files correctly (as configured)
95,144
18.03.2020 16:37:00
-3,600
69ec5cda68a046f0713557cff1217e252bd49645
Allow overriding of order in URL parameter
[ { "change_type": "MODIFY", "old_path": "src/Controller/Frontend/ListingController.php", "new_path": "src/Controller/Frontend/ListingController.php", "diff": "@@ -44,7 +44,7 @@ class ListingController extends TwigAwareController implements FrontendZoneInter\n$contentType = ContentType::factory($contentTypeSlug, $this->config->get('contenttypes'));\n$page = (int) $request->query->get('page', 1);\n$amountPerPage = $contentType->get('listing_records');\n- $order = $contentType->get('sort');\n+ $order = $request->query->get('order', $contentType->get('order'));\n$records = $this->query->getContent($contentTypeSlug, [\n'status' => 'published',\n" } ]
PHP
MIT License
bolt/core
Allow overriding of order in URL parameter
95,144
18.03.2020 16:43:18
-3,600
4b75fa29285204d48ddbe4138def58b51f5fa421
Refactor `sort:` to `order:`
[ { "change_type": "MODIFY", "old_path": "config/bolt/contenttypes.yaml", "new_path": "config/bolt/contenttypes.yaml", "diff": "@@ -98,7 +98,7 @@ pages:\nfilter: '*.twig'\ntaxonomy: [ groups ]\nlisting_records: 6\n- sort: id\n+ order: id\nlocales: ['en', 'nl', 'ja', 'nb']\n# Entries can be used for things like 'news' or 'blogpostings'. They have a\n@@ -109,7 +109,7 @@ pages:\n# page from your news-item.\n# This ContentType defines 'categories' and 'tags' as taxonomies, allowing the\n# editor to use both to categorize a specific entry.\n-# The 'sort' is set to '-datepublish', which means that newer entries will be\n+# The 'order' is set to '-datepublish', which means that newer entries will be\n# shown above older entries.\nentries:\n@@ -145,7 +145,7 @@ entries:\nlisting_template: listing.twig\nlisting_records: 6\ndefault_status: published\n- sort: -publishedAt\n+ order: -publishedAt\nrecords_per_page: 10\nicon_many: \"fa:file-alt\"\nicon_one: \"fa:file-alt\"\n@@ -316,7 +316,7 @@ blocks:\nsearchable: false\nicon_many: \"fa:cubes\"\nicon_one: \"fa:cube\"\n- sort: title\n+ order: title\nrecords_per_page: 12\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/ContentTypesParser.php", "new_path": "src/Configuration/Parser/ContentTypesParser.php", "diff": "@@ -157,7 +157,7 @@ class ContentTypesParser extends BaseParser\n$contentType['fields'] = $fields;\n$contentType['groups'] = $groups;\n- $contentType['sort'] = $this->determineSort($contentType);\n+ $contentType['order'] = $this->determineOrder($contentType);\n// Make sure title_format is set\nif (isset($contentType['title_format'])) {\n@@ -322,9 +322,9 @@ class ContentTypesParser extends BaseParser\nreturn $repeater;\n}\n- private function determineSort(array $contentType): string\n+ private function determineOrder(array $contentType): string\n{\n- $sort = $contentType['sort'] ?? '-createdAt';\n+ $order = $contentType['order'] ?? $contentType['sort'] ?? '-createdAt';\n$replacements = [\n'created' => 'createdAt',\n@@ -340,15 +340,15 @@ class ContentTypesParser extends BaseParser\n'AtAt' => 'At',\n];\n- $sort = str_replace(array_keys($replacements), array_values($replacements), $sort);\n+ $order = str_replace(array_keys($replacements), array_values($replacements), $order);\n- $sortname = trim($sort, '-');\n+ $orderName = trim($order, '-');\n- if (! in_array($sortname, array_keys($contentType['fields']), true) &&\n- ! in_array($sortname, ['createdAt', 'modifiedAt', 'publishedAt', 'id'], true)) {\n- $sort = '-createdAt';\n+ if (! in_array($orderName, array_keys($contentType['fields']), true) &&\n+ ! in_array($orderName, ['createdAt', 'modifiedAt', 'publishedAt', 'id'], true)) {\n+ $order = '-createdAt';\n}\n- return $sort;\n+ return $order;\n}\n}\n" }, { "change_type": "RENAME", "old_path": "src/Controller/Backend/ContentOverviewController.php", "new_path": "src/Controller/Backend/ListingController.php", "diff": "@@ -15,7 +15,7 @@ use Symfony\\Component\\Routing\\Annotation\\Route;\n/**\n* @Security(\"is_granted('ROLE_ADMIN')\")\n*/\n-class ContentOverviewController extends TwigAwareController implements BackendZoneInterface\n+class ListingController extends TwigAwareController implements BackendZoneInterface\n{\n/**\n* @Route(\"/content/{contentType}\", name=\"bolt_content_overview\")\n@@ -32,7 +32,7 @@ class ContentOverviewController extends TwigAwareController implements BackendZo\nif ($request->get('sortBy')) {\n$params['order'] = $request->get('sortBy');\n} else {\n- $params['order'] = $contentTypeObject->get('sort');\n+ $params['order'] = $contentTypeObject->get('order');\n}\nif ($request->get('filter')) {\n" }, { "change_type": "MODIFY", "old_path": "tests/php/Configuration/Parser/ContentTypesParserTest.php", "new_path": "tests/php/Configuration/Parser/ContentTypesParserTest.php", "diff": "@@ -120,7 +120,7 @@ class ContentTypesParserTest extends ParserTestBase\n$this->assertSame('bar', $config['bars']['singular_slug']);\n$this->assertTrue($config['bars']['show_on_dashboard']);\n$this->assertTrue($config['bars']['show_in_menu']);\n- $this->assertSame('-createdAt', $config['bars']['sort']);\n+ $this->assertSame('-createdAt', $config['bars']['order']);\n$this->assertFalse($config['bars']['viewless']);\n$this->assertSame('fa-file', $config['bars']['icon_one']);\n$this->assertSame('fa-copy', $config['bars']['icon_many']);\n" } ]
PHP
MIT License
bolt/core
Refactor `sort:` to `order:`
95,144
18.03.2020 17:29:45
-3,600
fa48221b158511e658084662baa7f82c07b88b3f
Make order work for relations
[ { "change_type": "MODIFY", "old_path": "src/Twig/RelatedExtension.php", "new_path": "src/Twig/RelatedExtension.php", "diff": "@@ -122,12 +122,15 @@ class RelatedExtension extends AbstractExtension\nreturn null;\n}\n- public function getRelatedOptions(string $contentTypeSlug): Collection\n+ public function getRelatedOptions(string $contentTypeSlug, ?string $order = null): Collection\n{\n$maxAmount = $this->config->get('maximum_listing_select', 1000);\n$contentType = $this->config->getContentType($contentTypeSlug);\n+\n+ if (!$order) {\n$order = $contentType->get('order');\n+ }\n$pager = $this->query->getContent($contentTypeSlug, ['order' => $order])\n->setMaxPerPage($maxAmount)\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_relationships.html.twig", "new_path": "templates/content/_relationships.html.twig", "diff": "{% for contentType, relation in record.definition.relations %}\n- {% set options = related_options(contentType) %}\n+ {% set options = related_options(contentType, relation.order|default()) %}\n{% set value = record|related_values(contentType) %}\n<div class=\"form-group is-normal\">\n" } ]
PHP
MIT License
bolt/core
Make order work for relations
95,144
18.03.2020 17:59:57
-3,600
a329247d3bdc83e7884f8cdf40418210bde4bf10
Prepare release 4.0.0-rc.10
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "},\n\"is-obj\": {\n\"version\": \"1.0.1\",\n- \"resolved\": \"https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz\",\n+ \"resolved\": \"http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz\",\n\"integrity\": \"sha1-PkcprB9f3gJc19g6iW2rn09n2w8=\"\n},\n\"is-path-cwd\": {\n},\n\"load-json-file\": {\n\"version\": \"1.1.0\",\n- \"resolved\": \"https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz\",\n+ \"resolved\": \"http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz\",\n\"integrity\": \"sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=\",\n\"dev\": true,\n\"requires\": {\n},\n\"mkdirp\": {\n\"version\": \"0.5.1\",\n- \"resolved\": \"https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz\",\n+ \"resolved\": \"http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz\",\n\"integrity\": \"sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=\",\n\"requires\": {\n\"minimist\": \"0.0.8\"\n},\n\"semver\": {\n\"version\": \"5.3.0\",\n- \"resolved\": \"https://registry.npmjs.org/semver/-/semver-5.3.0.tgz\",\n+ \"resolved\": \"http://registry.npmjs.org/semver/-/semver-5.3.0.tgz\",\n\"integrity\": \"sha1-myzl094C0XxgEq0yaqa00M9U+U8=\",\n\"dev\": true\n}\n},\n\"safe-regex\": {\n\"version\": \"1.1.0\",\n- \"resolved\": \"https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz\",\n+ \"resolved\": \"http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz\",\n\"integrity\": \"sha1-QKNmnzsHfR6UPURinhV91IAjvy4=\",\n\"requires\": {\n\"ret\": \"~0.1.10\"\n},\n\"load-json-file\": {\n\"version\": \"1.1.0\",\n- \"resolved\": \"https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz\",\n+ \"resolved\": \"http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz\",\n\"integrity\": \"sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=\",\n\"dev\": true,\n\"requires\": {\n},\n\"os-locale\": {\n\"version\": \"1.4.0\",\n- \"resolved\": \"https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz\",\n+ \"resolved\": \"http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz\",\n\"integrity\": \"sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=\",\n\"dev\": true,\n\"requires\": {\n},\n\"strip-ansi\": {\n\"version\": \"3.0.1\",\n- \"resolved\": \"https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz\",\n+ \"resolved\": \"http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz\",\n\"integrity\": \"sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=\",\n\"requires\": {\n\"ansi-regex\": \"^2.0.0\"\n},\n\"strip-eof\": {\n\"version\": \"1.0.0\",\n- \"resolved\": \"https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz\",\n+ \"resolved\": \"http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz\",\n\"integrity\": \"sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=\"\n},\n\"strip-final-newline\": {\n}\n},\n\"terser\": {\n- \"version\": \"4.6.6\",\n- \"resolved\": \"https://registry.npmjs.org/terser/-/terser-4.6.6.tgz\",\n- \"integrity\": \"sha512-4lYPyeNmstjIIESr/ysHg2vUPRGf2tzF9z2yYwnowXVuVzLEamPN1Gfrz7f8I9uEPuHcbFlW4PLIAsJoxXyJ1g==\",\n+ \"version\": \"4.6.7\",\n+ \"resolved\": \"https://registry.npmjs.org/terser/-/terser-4.6.7.tgz\",\n+ \"integrity\": \"sha512-fmr7M1f7DBly5cX2+rFDvmGBAaaZyPrHYK4mMdHEDAdNTqXSZgSOfqsfGq2HqPGT/1V0foZZuCZFx8CHKgAk3g==\",\n\"requires\": {\n\"commander\": \"^2.20.0\",\n\"source-map\": \"~0.6.1\",\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "{\n\"name\": \"bolt\",\n- \"version\": \"4.0.0-rc.9\",\n+ \"version\": \"4.0.0-rc.10\",\n\"homepage\": \"https://boltcms.io\",\n\"author\": \"Bob den Otter <bob@twokings.nl> (https://boltcms.io)\",\n\"license\": \"MIT\",\n" } ]
PHP
MIT License
bolt/core
Prepare release 4.0.0-rc.10
95,144
19.03.2020 06:42:31
-3,600
89369ab301fe8ef9514ac2e03b1854df6a0a4357
Make it more clear that regular users cant login
[ { "change_type": "MODIFY", "old_path": "src/Command/AddUserCommand.php", "new_path": "src/Command/AddUserCommand.php", "diff": "@@ -199,7 +199,13 @@ class AddUserCommand extends Command\n$this->entityManager->persist($user);\n$this->entityManager->flush();\n- $this->io->success(sprintf('%s was successfully created: %s (%s)', $isAdmin ? 'Administrator user' : 'User', $user->getUsername(), $user->getEmail()));\n+ if (! $isAdmin) {\n+ $this->io->success(sprintf('User was successfully created: %s (%s)', $user->getUsername(), $user->getEmail()));\n+ $this->io->warning(\"Note: regular users CAN NOT log in to the Bolt backend. Create a user with the `--admin` flag instead, if this is what you intended.\");\n+ } else {\n+ $this->io->success(sprintf('Administrator user was successfully created: %s (%s)', $user->getUsername(), $user->getEmail()));\n+ }\n+\n$event = $stopwatch->stop('add-user-command');\nif ($output->isVerbose()) {\n" }, { "change_type": "MODIFY", "old_path": "src/Utils/Validator.php", "new_path": "src/Utils/Validator.php", "diff": "@@ -20,8 +20,8 @@ class Validator\nthrow new InvalidArgumentException('The username can not be empty.');\n}\n- if (preg_match('/^[a-z_]+$/', $username) !== 1) {\n- throw new InvalidArgumentException('The username must contain only lowercase latin characters and underscores.');\n+ if (preg_match('/^[a-z0-9_]+$/', $username) !== 1) {\n+ throw new InvalidArgumentException('The username must contain only lowercase latin characters, numbers and underscores.');\n}\nreturn $username;\n" } ]
PHP
MIT License
bolt/core
Make it more clear that regular users cant login
95,144
20.03.2020 06:13:10
-3,600
3e9157731c1ed553c30173b53549376f7e34b920
Set default (fallback) permissions correctly
[ { "change_type": "MODIFY", "old_path": "src/Command/CopyAssetsCommand.php", "new_path": "src/Command/CopyAssetsCommand.php", "diff": "@@ -103,7 +103,7 @@ class CopyAssetsCommand extends Command\n*/\nprivate function hardCopy(string $originDir, string $targetDir): void\n{\n- $mode = $this->config->get('general/filepermissions/folders', 0774);\n+ $mode = $this->config->get('general/filepermissions/folders', 0775);\n$this->filesystem->mkdir($targetDir, $mode);\n// We use a custom iterator to ignore VCS files\n" }, { "change_type": "MODIFY", "old_path": "src/Command/CopyThemesCommand.php", "new_path": "src/Command/CopyThemesCommand.php", "diff": "@@ -106,7 +106,7 @@ class CopyThemesCommand extends Command\n*/\nprivate function hardCopy(string $originDir, string $targetDir): void\n{\n- $mode = $this->config->get('general/filepermissions/folders', 0774);\n+ $mode = $this->config->get('general/filepermissions/folders', 0775);\n$this->filesystem->mkdir($targetDir, $mode);\n// We use a custom iterator to ignore VCS files\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/ImageController.php", "new_path": "src/Controller/ImageController.php", "diff": "@@ -85,7 +85,7 @@ class ImageController\n$filesystem = new Filesystem();\n$filePath = sprintf('%s%s%s%s%s', $this->getPath('thumbs'), DIRECTORY_SEPARATOR, $paramString, DIRECTORY_SEPARATOR, $filename);\n- $folderMode = $this->config->get('general/filepermissions/folders', 0774);\n+ $folderMode = $this->config->get('general/filepermissions/folders', 0775);\n$fileMode = $this->config->get('general/filepermissions/files', 0664);\ntry {\n" } ]
PHP
MIT License
bolt/core
Set default (fallback) permissions correctly
95,144
20.03.2020 06:40:48
-3,600
43d94457133d0770660e7c712185daeba18ed301
Only search in contenttypes that have `searchable: true`
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/ContentTypesParser.php", "new_path": "src/Configuration/Parser/ContentTypesParser.php", "diff": "@@ -105,6 +105,15 @@ class ContentTypesParser extends BaseParser\nif (! isset($contentType['viewless'])) {\n$contentType['viewless'] = false;\n}\n+ if (! isset($contentType['searchable'])) {\n+ $contentType['searchable'] = ! $contentType['viewless'];\n+ }\n+\n+ // When Viewless it makes makes no sense to have it searchable\n+ if ($contentType['viewless']) {\n+ $contentType['searchable'] = false;\n+ }\n+\nif (! isset($contentType['icon_one'])) {\n$contentType['icon_one'] = 'fa-file';\n} else {\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Frontend/SearchController.php", "new_path": "src/Controller/Frontend/SearchController.php", "diff": "@@ -37,11 +37,14 @@ class SearchController extends TwigAwareController implements FrontendZoneInterf\n$page = (int) $request->query->get('page', 1);\n$searchTerm = $request->get('searchTerm', $request->get('search', $request->get('q', '')));\n$searchTerm = $this->sanitiser->clean($searchTerm);\n- $amountPerPage = $this->config->get('general/listing_records');\n+ $amountPerPage = (int) $this->config->get('general/listing_records');\n+\n+ // Just the ContentTypes that have `searchable: true`\n+ $contentTypes = $this->config->get('contenttypes')->where('searchable', true)->keys()->all();\n// @todo implement actual Search Engine\nif (! empty($searchTerm)) {\n- $records = $contentRepository->searchNaive($searchTerm, $page, $amountPerPage);\n+ $records = $contentRepository->searchNaive($searchTerm, $page, $amountPerPage, $contentTypes);\n} else {\n$records = new Pagerfanta(new ArrayAdapter([]));\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Repository/ContentRepository.php", "new_path": "src/Repository/ContentRepository.php", "diff": "@@ -84,7 +84,7 @@ class ContentRepository extends ServiceEntityRepository\nreturn $this->createPaginator($qb->getQuery(), $page, $amount);\n}\n- public function searchNaive(string $searchTerm, int $page, int $amountPerPage, bool $onlyPublished = true): Pagerfanta\n+ public function searchNaive(string $searchTerm, int $page, int $amountPerPage, array $contentTypes = [], bool $onlyPublished = true): Pagerfanta\n{\n// First, create a querybuilder to get the fields that match the Query\n$qb = $this->getQueryBuilder()\n@@ -110,6 +110,11 @@ class ContentRepository extends ServiceEntityRepository\n->setParameter('status', Statuses::PUBLISHED);\n}\n+ if (! empty($contentTypes)) {\n+ $qb->andWhere('content.contentType IN (:cts)')\n+ ->setParameter('cts', $contentTypes);\n+ }\n+\n$qb->andWhere('content.id IN (:ids)')\n->setParameter('ids', $ids);\n" }, { "change_type": "MODIFY", "old_path": "tests/php/Configuration/Parser/ContentTypesParserTest.php", "new_path": "tests/php/Configuration/Parser/ContentTypesParserTest.php", "diff": "@@ -15,7 +15,7 @@ class ContentTypesParserTest extends ParserTestBase\n{\npublic const NUMBER_OF_CONTENT_TYPES_IN_MINIMAL_FILE = 2;\n- public const AMOUNT_OF_ATTRIBUTES_IN_CONTENT_TYPE = 23;\n+ public const AMOUNT_OF_ATTRIBUTES_IN_CONTENT_TYPE = 24;\npublic const AMOUNT_OF_ATTRIBUTES_IN_FIELD = 22;\n" } ]
PHP
MIT License
bolt/core
Only search in contenttypes that have `searchable: true`
95,144
20.03.2020 06:47:25
-3,600
a1f02ce7b947ab416659b14ae031fe4a15ead853
Only show on Dashboard if `show_on_dashboard: true`
[ { "change_type": "MODIFY", "old_path": "src/Controller/Backend/DashboardController.php", "new_path": "src/Controller/Backend/DashboardController.php", "diff": "@@ -21,11 +21,11 @@ class DashboardController extends TwigAwareController implements BackendZoneInte\n/**\n* @Route(\"/\", name=\"bolt_dashboard\", methods={\"GET\"})\n*/\n- public function index(ContentRepository $content, Request $request, Config $config): Response\n+ public function index(ContentRepository $content, Request $request): Response\n{\n$amount = (int) $this->config->get('general/records_per_page', 10);\n$page = (int) $request->get('page', 1);\n- $contentTypes = $config->get('contenttypes');\n+ $contentTypes = $this->config->get('contenttypes')->where('show_on_dashboard', true);\n/** @var Content $records */\n$records = $content->findLatest($contentTypes, $page, $amount);\n" } ]
PHP
MIT License
bolt/core
Only show on Dashboard if `show_on_dashboard: true`
95,144
20.03.2020 06:54:24
-3,600
c5629202d03080bf4573e85112cfab858a877d7d
Simplify passing contenttypes
[ { "change_type": "MODIFY", "old_path": "src/Controller/Frontend/SearchController.php", "new_path": "src/Controller/Frontend/SearchController.php", "diff": "@@ -40,7 +40,7 @@ class SearchController extends TwigAwareController implements FrontendZoneInterf\n$amountPerPage = (int) $this->config->get('general/listing_records');\n// Just the ContentTypes that have `searchable: true`\n- $contentTypes = $this->config->get('contenttypes')->where('searchable', true)->keys()->all();\n+ $contentTypes = $this->config->get('contenttypes')->where('searchable', true);\n// @todo implement actual Search Engine\nif (! empty($searchTerm)) {\n" }, { "change_type": "MODIFY", "old_path": "src/Repository/ContentRepository.php", "new_path": "src/Repository/ContentRepository.php", "diff": "@@ -84,7 +84,7 @@ class ContentRepository extends ServiceEntityRepository\nreturn $this->createPaginator($qb->getQuery(), $page, $amount);\n}\n- public function searchNaive(string $searchTerm, int $page, int $amountPerPage, array $contentTypes = [], bool $onlyPublished = true): Pagerfanta\n+ public function searchNaive(string $searchTerm, int $page, int $amountPerPage, Collection $contentTypes, bool $onlyPublished = true): Pagerfanta\n{\n// First, create a querybuilder to get the fields that match the Query\n$qb = $this->getQueryBuilder()\n@@ -110,10 +110,8 @@ class ContentRepository extends ServiceEntityRepository\n->setParameter('status', Statuses::PUBLISHED);\n}\n- if (! empty($contentTypes)) {\n$qb->andWhere('content.contentType IN (:cts)')\n- ->setParameter('cts', $contentTypes);\n- }\n+ ->setParameter('cts', $contentTypes->keys()->all());\n$qb->andWhere('content.id IN (:ids)')\n->setParameter('ids', $ids);\n" } ]
PHP
MIT License
bolt/core
Simplify passing contenttypes
95,144
21.03.2020 11:01:23
-3,600
a14fb93fc04ec2e681d2482b8468dac8c0d0c668
Make `show_in_menu` work as expected
[ { "change_type": "MODIFY", "old_path": "src/Menu/BackendMenuBuilder.php", "new_path": "src/Menu/BackendMenuBuilder.php", "diff": "@@ -11,6 +11,7 @@ use Bolt\\Twig\\ContentExtension;\nuse Bolt\\Version;\nuse Knp\\Menu\\FactoryInterface;\nuse Knp\\Menu\\ItemInterface;\n+use Knp\\Menu\\MenuItem;\nuse Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface;\nuse Symfony\\Contracts\\Translation\\TranslatorInterface;\n@@ -56,6 +57,7 @@ final class BackendMenuBuilder implements BackendMenuBuilderInterface\n{\n$t = $this->translator;\n+ /** @var MenuItem $menu */\n$menu = $this->menuFactory->createItem('root');\n$menu->addChild('Dashboard', [\n@@ -74,25 +76,9 @@ final class BackendMenuBuilder implements BackendMenuBuilderInterface\n],\n]);\n- /** @var ContentType[] $contentTypes */\n- $contentTypes = $this->config->get('contenttypes');\n+ $this->addContentItems($menu);\n- foreach ($contentTypes as $contentType) {\n- $menu->addChild($contentType->getSlug(), [\n- 'uri' => $this->urlGenerator->generate('bolt_content_overview', ['contentType' => $contentType->getSlug()]),\n- 'extras' => [\n- 'name' => $contentType['name'],\n- 'singular_name' => $contentType['singular_name'],\n- 'slug' => $contentType->getSlug(),\n- 'singular_slug' => $contentType['singular_slug'],\n- 'icon' => $contentType['icon_many'],\n- 'link_new' => $this->urlGenerator->generate('bolt_content_new', ['contentType' => $contentType->getSlug()]),\n- 'singleton' => $contentType['singleton'],\n- 'active' => $contentType->getSlug() === 'pages' ? true : false,\n- 'submenu' => $this->getLatestRecords($contentType),\n- ],\n- ]);\n- }\n+ $this->addContentOthers($menu);\n$menu->addChild('Settings', [\n'extras' => [\n@@ -313,6 +299,61 @@ final class BackendMenuBuilder implements BackendMenuBuilderInterface\nreturn $menu;\n}\n+ private function addContentItems(MenuItem $menu): void\n+ {\n+ /** @var ContentType[] $contentTypes */\n+ $contentTypes = $this->config->get('contenttypes')->whereStrict('show_in_menu', true);\n+\n+ foreach ($contentTypes as $contentType) {\n+ $menu->addChild($contentType->getSlug(), [\n+ 'uri' => $this->urlGenerator->generate('bolt_content_overview', ['contentType' => $contentType->getSlug()]),\n+ 'extras' => [\n+ 'name' => $contentType['name'],\n+ 'singular_name' => $contentType['singular_name'],\n+ 'slug' => $contentType->getSlug(),\n+ 'singular_slug' => $contentType['singular_slug'],\n+ 'icon' => $contentType['icon_many'],\n+ 'link_new' => $this->urlGenerator->generate('bolt_content_new', ['contentType' => $contentType->getSlug()]),\n+ 'singleton' => $contentType['singleton'],\n+ 'active' => $contentType->getSlug() === 'pages' ? true : false,\n+ 'submenu' => $this->getLatestRecords($contentType),\n+ ],\n+ ]);\n+ }\n+ }\n+\n+ private function addContentOthers(MenuItem $menu): void\n+ {\n+ $t = $this->translator;\n+ /** @var ContentType[] $contentTypes */\n+ $contentTypes = $this->config->get('contenttypes')->where('show_in_menu', '!==', true);\n+\n+ foreach ($contentTypes as $contentType) {\n+ $label = $contentType->get('show_in_menu') ?: $t->trans('caption.other_content');\n+\n+ if (! $menu->getChild($label)) {\n+ // Add the top level item\n+ $menu->addChild($label, [\n+ 'extras' => [\n+ 'name' => $label,\n+ 'icon' => $contentType->get('icon_many'),\n+ 'slug' => $label,\n+ ],\n+ ]);\n+ }\n+\n+ // Add the children to it.\n+ $menu->getChild($label)->addChild($contentType->get('slug'), [\n+ 'uri' => $this->urlGenerator->generate('bolt_content_overview', ['contentType' => $contentType->getSlug()]),\n+ 'extras' => [\n+ 'name' => $contentType->get('name'),\n+ 'icon' => $contentType->get('icon_many'),\n+ 'singleton' => $contentType->get('singleton'),\n+ ],\n+ ]);\n+ }\n+ }\n+\nprivate function getLatestRecords(ContentType $contentType): array\n{\n$records = $this->contentRepository->findLatest($contentType, 1, self::MAX_LATEST_RECORDS);\n" }, { "change_type": "MODIFY", "old_path": "translations/messages.en.xlf", "new_path": "translations/messages.en.xlf", "diff": "<target>your password</target>\n</segment>\n</unit>\n+ <unit id=\"KshyLfh\" name=\"caption.other_content\">\n+ <segment>\n+ <source>caption.other_content</source>\n+ <target>Other Content</target>\n+ </segment>\n+ </unit>\n</file>\n</xliff>\n" } ]
PHP
MIT License
bolt/core
Make `show_in_menu` work as expected
95,144
21.03.2020 11:51:06
-3,600
8a6138278dc016c11e232ad9cbb626f878ee1a77
Don't show slugs for contenttypes without slugs
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Content/FieldType.php", "new_path": "src/Configuration/Content/FieldType.php", "diff": "@@ -47,6 +47,7 @@ class FieldType extends Collection\n'readonly' => false,\n'error' => false,\n'pattern' => false,\n+ 'hidden' => false,\n]);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/ContentTypesParser.php", "new_path": "src/Configuration/Parser/ContentTypesParser.php", "diff": "@@ -215,8 +215,13 @@ class ContentTypesParser extends BaseParser\n$groups = [];\n$acceptFileTypes = $this->generalConfig->get('accept_file_types');\n+ // Even if there's no `slug` defined, we still want to have one. We mark\n+ // it as 'hidden', so we don't show it when editing the Content\nif (! isset($fields['slug'])) {\n- $fields['slug'] = ['type' => 'slug'];\n+ $fields['slug'] = [\n+ 'type' => 'slug',\n+ 'hidden' => true,\n+ ];\n}\nforeach ($fields as $key => $field) {\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Content.php", "new_path": "src/Entity/Content.php", "diff": "@@ -211,14 +211,19 @@ class Content\n$slug = $this->getField('slug')->setLocale($locale)->getParsedValue();\n}\n- if ($slug === null) {\n- // if no slug exists for the current/requested locale, default back\n+ // if no slug exists for the current/requested locale, default fallback\n+ if (! $slug) {\n$slug = $this\n->getField('slug')\n->setLocale($this->getField('slug')->getDefaultLocale())\n->getParsedValue();\n}\n+ // In case the ContentType has no slug defined, we've no other option than to use the id\n+ if (! $slug) {\n+ $slug = (string) $this->getId();\n+ }\n+\nreturn $slug;\n}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_fields.html.twig", "new_path": "templates/content/_fields.html.twig", "diff": "{% set field = field_factory(key, fielddefinition) %}\n{% endif %}\n+ {% if not field.definition.hidden %}\n{% include [\n'@bolt/_partials/fields/' ~ fielddefinition.type ~ '.html.twig',\n'@bolt/_partials/fields/generic.html.twig'\n] with { 'field' : field } %}\n+ {% endif %}\n{% endfor %}\n</div>\n" }, { "change_type": "MODIFY", "old_path": "tests/php/Configuration/Parser/ContentTypesParserTest.php", "new_path": "tests/php/Configuration/Parser/ContentTypesParserTest.php", "diff": "@@ -17,7 +17,7 @@ class ContentTypesParserTest extends ParserTestBase\npublic const AMOUNT_OF_ATTRIBUTES_IN_CONTENT_TYPE = 24;\n- public const AMOUNT_OF_ATTRIBUTES_IN_FIELD = 22;\n+ public const AMOUNT_OF_ATTRIBUTES_IN_FIELD = 23;\npublic const ALLOWED_LOCALES = 'en|nl|es|fr|de|pl|it|hu|pt_BR|ja|nb|nn|nl_NL|nl_BE';\n" } ]
PHP
MIT License
bolt/core
Don't show slugs for contenttypes without slugs
95,144
21.03.2020 12:15:27
-3,600
0c16a7ce6fbb84758bc227dc8c8db0f6555fd536
Don't fill placeholders for ImageField if filename is not set.
[ { "change_type": "MODIFY", "old_path": "src/Entity/Field/ImageField.php", "new_path": "src/Entity/Field/ImageField.php", "diff": "@@ -29,16 +29,22 @@ class ImageField extends Field implements FieldInterface, MediaAwareInterface\npublic function __construct()\n{\n- $this->fieldBase = [\n+\n+ $this->alt = [\n+ 'alt' => '',\n+ ];\n+ }\n+\n+ private function getFieldBase()\n+ {\n+ return [\n'filename' => '',\n'path' => '',\n'media' => '',\n'thumbnail' => '',\n'fieldname' => '',\n- ];\n-\n- $this->alt = [\n'alt' => '',\n+ 'url' => '',\n];\n}\n@@ -49,15 +55,16 @@ class ImageField extends Field implements FieldInterface, MediaAwareInterface\npublic function getValue(): array\n{\n- $value = array_merge($this->fieldBase, (array) parent::getValue() ?: []);\n-\n- if ($this->includeAlt()) {\n- $value = array_merge($this->alt, $value);\n- }\n+ $value = array_merge($this->getFieldBase(), (array) parent::getValue() ?: []);\n// Remove cruft field getting stored as JSON.\nunset($value[0]);\n+ // If the filename isn't set, we're done: return the array with placeholders\n+ if (! $value['filename']) {\n+ return $value;\n+ }\n+\n// Generate a URL\n$value['path'] = $this->getPath();\n@@ -73,6 +80,7 @@ class ImageField extends Field implements FieldInterface, MediaAwareInterface\n$value['fieldname'] = $this->getName();\n+ dd($value);\nreturn $value;\n}\n" } ]
PHP
MIT License
bolt/core
Don't fill placeholders for ImageField if filename is not set.
95,144
28.03.2020 10:45:49
-3,600
8ce8f338262f90206418a13cf468164be266e50d
Make it work for select from content
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "},\n\"is-obj\": {\n\"version\": \"1.0.1\",\n- \"resolved\": \"http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz\",\n+ \"resolved\": \"https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz\",\n\"integrity\": \"sha1-PkcprB9f3gJc19g6iW2rn09n2w8=\"\n},\n\"is-path-cwd\": {\n},\n\"load-json-file\": {\n\"version\": \"1.1.0\",\n- \"resolved\": \"http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz\",\n+ \"resolved\": \"https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz\",\n\"integrity\": \"sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=\",\n\"dev\": true,\n\"requires\": {\n},\n\"mkdirp\": {\n\"version\": \"0.5.1\",\n- \"resolved\": \"http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz\",\n+ \"resolved\": \"https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz\",\n\"integrity\": \"sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=\",\n\"requires\": {\n\"minimist\": \"0.0.8\"\n},\n\"semver\": {\n\"version\": \"5.3.0\",\n- \"resolved\": \"http://registry.npmjs.org/semver/-/semver-5.3.0.tgz\",\n+ \"resolved\": \"https://registry.npmjs.org/semver/-/semver-5.3.0.tgz\",\n\"integrity\": \"sha1-myzl094C0XxgEq0yaqa00M9U+U8=\",\n\"dev\": true\n}\n},\n\"safe-regex\": {\n\"version\": \"1.1.0\",\n- \"resolved\": \"http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz\",\n+ \"resolved\": \"https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz\",\n\"integrity\": \"sha1-QKNmnzsHfR6UPURinhV91IAjvy4=\",\n\"requires\": {\n\"ret\": \"~0.1.10\"\n},\n\"load-json-file\": {\n\"version\": \"1.1.0\",\n- \"resolved\": \"http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz\",\n+ \"resolved\": \"https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz\",\n\"integrity\": \"sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=\",\n\"dev\": true,\n\"requires\": {\n},\n\"os-locale\": {\n\"version\": \"1.4.0\",\n- \"resolved\": \"http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz\",\n+ \"resolved\": \"https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz\",\n\"integrity\": \"sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=\",\n\"dev\": true,\n\"requires\": {\n},\n\"strip-ansi\": {\n\"version\": \"3.0.1\",\n- \"resolved\": \"http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz\",\n+ \"resolved\": \"https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz\",\n\"integrity\": \"sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=\",\n\"requires\": {\n\"ansi-regex\": \"^2.0.0\"\n},\n\"strip-eof\": {\n\"version\": \"1.0.0\",\n- \"resolved\": \"http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz\",\n+ \"resolved\": \"https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz\",\n\"integrity\": \"sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=\"\n},\n\"strip-final-newline\": {\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -474,6 +474,7 @@ class ContentExtension extends AbstractExtension\nif (is_iterable($values)) {\nreturn $this->selectOptionsArray($field);\n}\n+\nreturn $this->selectOptionsContentType($field);\n}\n@@ -515,7 +516,7 @@ class ContentExtension extends AbstractExtension\n$options = [];\n- if ($field->getDefinition()->get('required', false)) {\n+ if (! $field->getDefinition()->get('required')) {\n$options[] = [\n'key' => '',\n'value' => '',\n@@ -553,7 +554,10 @@ class ContentExtension extends AbstractExtension\n// We need to add this\nif ($taxonomy['allow_empty'] === true) {\n- $options[] = ['key' => '', 'value' => ''];\n+ $options[] = [\n+ 'key' => '',\n+ 'value' => '',\n+ ];\n}\nif ($taxonomy['behaves_like'] === 'tags') {\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/select.html.twig", "new_path": "templates/_partials/fields/select.html.twig", "diff": "- options: The actual options that are available in the select\n- multiple: A boolean to set whether or not we allow multiple selections\n- - allow_empty: A boolean to set whether or not we allow clearing the selection\n#}\n{% if options is not defined %}\n" } ]
PHP
MIT License
bolt/core
Make it work for select from content
95,144
28.03.2020 12:14:39
-3,600
f4a3f9b59c1c42c41e46d533e193e77a98e1497f
Make it work for relationships as well
[ { "change_type": "MODIFY", "old_path": "assets/js/app/editor/Components/Select.vue", "new_path": "assets/js/app/editor/Components/Select.vue", "diff": "<div :id=\"`multiselect-${id}`\">\n<multiselect\nv-model=\"selected\"\n- :allow-empty=\"false\"\n+ :allow-empty=\"allowempty\"\n:limit=\"1000\"\n:multiple=\"multiple\"\n:options=\"options\"\n@@ -49,6 +49,7 @@ export default {\nform: String,\noptions: Array,\nmultiple: Boolean,\n+ allowempty: Boolean,\ntaggable: Boolean,\nreadonly: Boolean,\nerrormessage: String | Boolean, //string if errormessage is set, and false otherwise\n" }, { "change_type": "MODIFY", "old_path": "config/bolt/taxonomy.yaml", "new_path": "config/bolt/taxonomy.yaml", "diff": "@@ -8,6 +8,7 @@ tags:\npostfix: \"Add some freeform tags. Start a new tag by typing a comma or space.\"\nallow_spaces: false\n#listing_template: tag-listing.twig #custom template\n+ required: false\ngroups:\nslug: groups\n@@ -15,6 +16,7 @@ groups:\nbehaves_like: grouping\noptions: { main: \"The main group\", meta: \"Meta group\", other: \"The other stuff\" }\nhas_sortorder: true\n+ required: false\ncategories:\nname: Categories\n@@ -24,3 +26,4 @@ categories:\nbehaves_like: categories\nmultiple: true\noptions: [ news, events, movies, music, books, life, love, fun ]\n+ required: false\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/TaxonomyParser.php", "new_path": "src/Configuration/Parser/TaxonomyParser.php", "diff": "@@ -50,8 +50,8 @@ class TaxonomyParser extends BaseParser\n$taxonomy['allow_spaces'] = false;\n}\n- if (isset($taxonomy['allow_empty']) === false) {\n- $taxonomy['allow_empty'] = true;\n+ if (isset($taxonomy['required']) === false) {\n+ $taxonomy['required'] = false;\n}\nif (isset($taxonomy['behaves_like']) === false) {\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Field/SelectField.php", "new_path": "src/Entity/Field/SelectField.php", "diff": "@@ -23,7 +23,10 @@ class SelectField extends Field implements FieldInterface\n$value = json_decode($value, false);\n}\n} finally {\n- parent::setValue((array) $value);\n+ // Array_filter filters out empty elements, but has the side effect\n+ // of making the array associative. We use Array_values to ensure we\n+ // have a sequential array.\n+ parent::setValue(array_values(array_filter((array) $value)));\n}\nreturn $this;\n@@ -42,7 +45,7 @@ class SelectField extends Field implements FieldInterface\n}\n}\n- return (array) $value;\n+ return array_filter((array) $value);\n}\npublic function getOptions()\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -122,8 +122,8 @@ class ContentExtension extends AbstractExtension\nnew TwigFunction('list_templates', [$this, 'getListTemplates']),\nnew TwigFunction('pager', [$this, 'pager'], $env + $safe),\nnew TwigFunction('select_options', [$this, 'selectOptions']),\n- new TwigFunction('taxonomyoptions', [$this, 'taxonomyoptions']),\n- new TwigFunction('taxonomyvalues', [$this, 'taxonomyvalues']),\n+ new TwigFunction('taxonomy_options', [$this, 'taxonomyOptions']),\n+ new TwigFunction('taxonomy_values', [$this, 'taxonomyValues']),\nnew TwigFunction('icon', [$this, 'icon'], $safe),\n];\n}\n@@ -485,6 +485,9 @@ class ContentExtension extends AbstractExtension\n$options = [];\n+ // We need to add this as a 'dummy' option for when the user is allowed\n+ // not to pick an option. This is needed, because otherwise the `select`\n+ // would default to the one.\nif (! $field->getDefinition()->get('required', true)) {\n$options[] = [\n'key' => '',\n@@ -548,12 +551,14 @@ class ContentExtension extends AbstractExtension\nreturn new LaravelCollection($options);\n}\n- public function taxonomyoptions(LaravelCollection $taxonomy): LaravelCollection\n+ public function taxonomyOptions(LaravelCollection $taxonomy): LaravelCollection\n{\n$options = [];\n- // We need to add this\n- if ($taxonomy['allow_empty'] === true) {\n+ // We need to add this as a 'dummy' option for when the user is allowed\n+ // not to pick an option. This is needed, because otherwise the `select`\n+ // would default to the first option.\n+ if ($taxonomy['required'] === false) {\n$options[] = [\n'key' => '',\n'value' => '',\n@@ -577,7 +582,7 @@ class ContentExtension extends AbstractExtension\nreturn new LaravelCollection($options);\n}\n- public function taxonomyvalues(\\Doctrine\\Common\\Collections\\Collection $current, LaravelCollection $taxonomy): LaravelCollection\n+ public function taxonomyValues(\\Doctrine\\Common\\Collections\\Collection $current, LaravelCollection $taxonomy): LaravelCollection\n{\n$values = [];\n@@ -589,7 +594,7 @@ class ContentExtension extends AbstractExtension\n$values = $values[$taxonomy['slug']] ?? [];\n}\n- if (empty($values) && ! $taxonomy['allow_empty']) {\n+ if (empty($values) && $taxonomy['required']) {\n$values[] = key($taxonomy['options']);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/RelatedExtension.php", "new_path": "src/Twig/RelatedExtension.php", "diff": "@@ -122,7 +122,7 @@ class RelatedExtension extends AbstractExtension\nreturn null;\n}\n- public function getRelatedOptions(string $contentTypeSlug, ?string $order = null, string $format = ''): Collection\n+ public function getRelatedOptions(string $contentTypeSlug, ?string $order = null, string $format = '', bool $required): Collection\n{\n$maxAmount = $this->config->get('maximum_listing_select', 1000);\n@@ -140,6 +140,16 @@ class RelatedExtension extends AbstractExtension\n$options = [];\n+ // We need to add this as a 'dummy' option for when the user is allowed\n+ // not to pick an option. This is needed, because otherwise the `select`\n+ // would default to the first one.\n+ if ($required === false) {\n+ $options[] = [\n+ 'key' => '',\n+ 'value' => '',\n+ ];\n+ }\n+\n/** @var Content $record */\nforeach ($records as $record) {\n$options[] = [\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/_label.html.twig", "new_path": "templates/_partials/fields/_label.html.twig", "diff": "-{%- if type != 'checkbox' -%}\n- <label for=\"{{ id }}\" class=\"editor--label{% if type == 'collection' %} sr-only{% endif %}\">\n+{%- if type|default() != 'checkbox' -%}\n+ <label for=\"{{ id }}\" class=\"editor--label{% if type|default() == 'collection' %} sr-only{% endif %}\">\n- {%- if localize -%}\n+ {%- if localize|default() -%}\n<i class=\"fas fa-language\"></i>\n{%- endif -%}\n{{- label -}}:\n{% if required %} <span class=\"required-label\"></span> {% endif %}\n- {% if info is not empty %}\n+ {% if info|default() %}\n<i class=\"fa fa-info-circle\" data-toggle=\"popover\" data-trigger=\"hover\" title=\"{{ label }}\" data-html=\"true\" data-content=\"{{ info }}\"></i>\n{% endif %}\n</label>\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/select.html.twig", "new_path": "templates/_partials/fields/select.html.twig", "diff": ":multiple=\"{{ multiple }}\"\n:readonly=\"{{ readonly|json_encode }}\"\n:errormessage='{{ errormessage|json_encode }}'\n+ :allowempty=\"{{ required ? 'false' : 'true' }}\"\n></editor-select>\n{% endblock %}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_relationships.html.twig", "new_path": "templates/content/_relationships.html.twig", "diff": "{% for contentType, relation in record.definition.relations %}\n- {% set options = related_options(contentType, relation.order|default(), relation.format|default()) %}\n+ {% set options = related_options(contentType, relation.order|default(), relation.format|default(), relation.required) %}\n{% set value = record|related_values(contentType) %}\n-{# {{ dump(relation) }}#}\n-\n<div class=\"form-group is-normal\">\n- <label for=\"field-title\">\n- {{ relation.label }}:\n- </label>\n+\n+ {% include '@bolt/_partials/fields/_label.html.twig' with {\n+ 'id': 'relationship-' ~ contentType,\n+ 'label': relation.label,\n+ 'required': relation.required\n+ } %}\n+\n<div>\n<editor-select\n:value=\"{{ value }}\"\n:options=\"{{ options }}\"\n:multiple=\"{{ relation.multiple ? 'true' : 'false' }}\"\n:taggable=false\n- :allowempty='true'\n+ :allowempty=\"{{ relation.required ? 'false' : 'true' }}\"\n></editor-select>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_taxonomies.html.twig", "new_path": "templates/content/_taxonomies.html.twig", "diff": "{% set definition = config.get('taxonomies/' ~ taxonomy) %}\n{% if definition %}\n- {% set options = taxonomyoptions(definition) %}\n- {% set value = taxonomyvalues(record.taxonomies, definition) %}\n+ {% set options = taxonomy_options(definition) %}\n+ {% set value = taxonomy_values(record.taxonomies, definition) %}\n<div class=\"form-group is-normal\">\n- <label for=\"field-title\">\n- {{ definition.name }}:\n- </label>\n+\n+ {% include '@bolt/_partials/fields/_label.html.twig' with {\n+ 'id': 'taxonomy-' ~ definition.slug,\n+ 'label': definition.name,\n+ 'required': definition.required\n+ } %}\n+\n+ {% dump(definition) %}\n+\n<div>\n<editor-select\n:value=\"{{ value }}\"\n:options=\"{{ options }}\"\n:multiple=\"{{ definition.multiple ? 'true' : 'false' }}\"\n:taggable=\"{{ (definition.behaves_like == 'tags') ? 'true' : 'false' }}\"\n- :allowempty={{ definition.allow_empty ? 'true' : 'false' }}\n+ :allowempty=\"{{ definition.required ? 'false' : 'true' }}\"\n></editor-select>\n</div>\n" } ]
PHP
MIT License
bolt/core
Make it work for relationships as well
95,144
28.03.2020 12:43:06
-3,600
c22a906c3ea1543c595a59b946568d8911114012
Don't break when trying to save a file that's not writable
[ { "change_type": "MODIFY", "old_path": "src/Controller/Backend/FileEditController.php", "new_path": "src/Controller/Backend/FileEditController.php", "diff": "@@ -15,6 +15,8 @@ use Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface;\nuse Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface;\nuse Symfony\\Component\\Yaml\\Exception\\ParseException;\nuse Symfony\\Component\\Yaml\\Parser;\n+use Webimpress\\SafeWriter\\Exception\\ExceptionInterface;\n+use Webimpress\\SafeWriter\\FileWriter;\nuse Webmozart\\PathUtil\\Path;\n/**\n@@ -38,6 +40,7 @@ class FileEditController extends TwigAwareController implements BackendZoneInter\nif (mb_strpos($file, '/') !== 0) {\n$file = '/' . $file;\n}\n+\n$basepath = $this->config->getPath($location);\n$filename = Path::canonicalize($basepath . '/' . $file);\n$contents = file_get_contents($filename);\n@@ -46,6 +49,7 @@ class FileEditController extends TwigAwareController implements BackendZoneInter\n'location' => $location,\n'file' => $file,\n'contents' => $contents,\n+ 'writable' => is_writable($filename),\n];\nreturn $this->renderTemplate('@bolt/finder/editfile.html.twig', $context);\n@@ -81,11 +85,11 @@ class FileEditController extends TwigAwareController implements BackendZoneInter\n$basepath = $this->config->getPath($locationName);\n$filename = Path::canonicalize($basepath . '/' . $file);\n- // @todo maybe replace file_put_contents with some more abstract Filesystem?\n- if (file_put_contents($filename, $contents)) {\n+ try {\n+ FileWriter::writeFile($filename, $contents);\n$this->addFlash('success', 'editfile.updated_successfully');\n- } else {\n- $this->addFlash('warn', 'editfile.could_not_write');\n+ } catch (ExceptionInterface $e) {\n+ $this->addFlash('warning', 'editfile.could_not_write');\n}\nreturn new RedirectResponse($url);\n" }, { "change_type": "MODIFY", "old_path": "templates/finder/editfile.html.twig", "new_path": "templates/finder/editfile.html.twig", "diff": "<textarea name=\"editfile\" id=\"editfile_textarea\">{{ contents }}</textarea>\n</div>\n<div class=\"form-group\">\n- <button class=\"btn btn-primary\" name=\"save\" type=\"submit\">{{ macro.icon('save') }}{{ 'action.save'|trans }}</button>\n+ <button class=\"btn btn-primary\" name=\"save\" type=\"submit\" {% if not writable %}disabled{% endif %}>{{ macro.icon('save') }}{{ 'action.save'|trans }}</button>\n+ {% if not writable %}{{ __('editfile.target_not_writable') }}{% endif %}\n</div>\n</div>\n</form>\n" }, { "change_type": "MODIFY", "old_path": "translations/messages.en.xlf", "new_path": "translations/messages.en.xlf", "diff": "<target>Other Content</target>\n</segment>\n</unit>\n+ <unit id=\"wHOF8eG\" name=\"editfile.target_not_writable\">\n+ <segment>\n+ <source>editfile.target_not_writable</source>\n+ <target>Saving is disabled, because the target file is not writable.</target>\n+ </segment>\n+ </unit>\n</file>\n</xliff>\n" } ]
PHP
MIT License
bolt/core
Don't break when trying to save a file that's not writable
95,144
28.03.2020 13:27:44
-3,600
090a537409a06f4cad7c89640e52b0cf04e645d0
Allow for taxonomy listings with singular Taxonomy Type slug
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Config.php", "new_path": "src/Configuration/Config.php", "diff": "@@ -193,6 +193,26 @@ class Config\nreturn null;\n}\n+ public function getTaxonomy(string $name): ?Collection\n+ {\n+ $name = trim($name);\n+\n+ if ($this->has('taxonomies/' . $name)) {\n+ return $this->get('taxonomies/' . $name);\n+ }\n+\n+ /** @var Collection $taxos */\n+ $taxos = $this->get('taxonomies');\n+\n+ foreach (['singular_slug', 'name', 'singular_name'] as $key) {\n+ if ($taxos->firstWhere($key, $name)) {\n+ return $taxos->firstWhere($key, $name);\n+ }\n+ }\n+\n+ return null;\n+ }\n+\npublic function getFileTypes(): Collection\n{\nreturn new Collection($this->get('general/accept_file_types'));\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Frontend/TaxonomyController.php", "new_path": "src/Controller/Frontend/TaxonomyController.php", "diff": "@@ -41,7 +41,7 @@ class TaxonomyController extends TwigAwareController implements FrontendZoneInte\n$page = (int) $request->query->get('page', 1);\n$amountPerPage = $this->config->get('general/listing_records');\n- $taxonomy = $this->config->get('taxonomies/'. $taxonomyslug);\n+ $taxonomy = $this->config->getTaxonomy($taxonomyslug);\n/** @var Content[] $records */\n$records = $contentRepository->findForTaxonomy($page, $taxonomy, $slug, $amountPerPage);\n" } ]
PHP
MIT License
bolt/core
Allow for taxonomy listings with singular Taxonomy Type slug
95,144
28.03.2020 14:40:02
-3,600
04b838d3be920ba46db6dd2f19632ed809e08343
Image URL uses canonical config setting
[ { "change_type": "MODIFY", "old_path": "src/Canonical.php", "new_path": "src/Canonical.php", "diff": "@@ -63,6 +63,9 @@ class Canonical\n$this->setScheme($configUrl['scheme']);\n$this->setHost($configUrl['host']);\n$this->setPort($configUrl['port'] ?? null);\n+\n+ $_SERVER['CANONICAL_HOST'] = $configUrl['host'];\n+ $_SERVER['CANONICAL_SCHEME'] = $configUrl['scheme'];\n}\npublic function get(?string $route = null, array $params = []): ?string\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Field/ImageField.php", "new_path": "src/Entity/Field/ImageField.php", "diff": "@@ -55,10 +55,7 @@ class ImageField extends Field implements FieldInterface, MediaAwareInterface\n// Generate a URL\n$value['path'] = $this->getPath();\n-\n- // @todo This needs to be injected, not created on the fly.\n- $request = Request::createFromGlobals();\n- $value['url'] = $request->getUriForPath($this->getPath());\n+ $value['url'] = $this->getUrl();\n$thumbPackage = new PathPackage('/thumbs/', new EmptyVersionStrategy());\n$thumbnailHelper = new ThumbnailHelper();\n@@ -69,13 +66,38 @@ class ImageField extends Field implements FieldInterface, MediaAwareInterface\nreturn $value;\n}\n- public function getPath(): string\n+ private function getPath(): string\n{\n$filesPackage = new PathPackage('/files/', new EmptyVersionStrategy());\nreturn $filesPackage->getUrl($this->get('filename'));\n}\n+ private function getUrl(): string\n+ {\n+ $request = Request::createFromGlobals();\n+\n+ return sprintf(\n+ '%s://%s%s',\n+ $request->getScheme(),\n+ $this->getHost($request),\n+ $this->getPath()\n+ );\n+ }\n+\n+ private function getHost($request)\n+ {\n+ $host = $request->server->get('CANONICAL_HOST', $request->getHost());\n+ $scheme = $request->getScheme();\n+ $port = $request->getPort();\n+\n+ if (($scheme === 'http' && $port === 80) || ($scheme === 'https' && $port === 443)) {\n+ return $host;\n+ }\n+\n+ return $host . ':'.$port;\n+ }\n+\npublic function getLinkedMedia(MediaRepository $mediaRepository): ?Media\n{\nif ($this->get('media')) {\n" } ]
PHP
MIT License
bolt/core
Image URL uses canonical config setting
95,144
28.03.2020 14:41:36
-3,600
98cb775574b207a22bb5d6a641fc666a421cb6a8
Take imagelist into account for the magic image
[ { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -8,6 +8,7 @@ use Bolt\\Configuration\\Config;\nuse Bolt\\Entity\\Content;\nuse Bolt\\Entity\\Field\\Excerptable;\nuse Bolt\\Entity\\Field\\ImageField;\n+use Bolt\\Entity\\Field\\ImagelistField;\nuse Bolt\\Entity\\Field\\SelectField;\nuse Bolt\\Entity\\Field\\TemplateselectField;\nuse Bolt\\Log\\LoggerTrait;\n@@ -220,6 +221,13 @@ class ContentExtension extends AbstractExtension\nif ($field instanceof ImageField && $field->get('filename')) {\nreturn $onlyValues ? $field->getValue() : $field;\n}\n+\n+ if ($field instanceof ImagelistField) {\n+ $firstImage = current($field->getValue());\n+ if ($firstImage->get('filename')) {\n+ return $onlyValues ? $firstImage->getValue() : $firstImage;\n+ }\n+ }\n}\nreturn null;\n" } ]
PHP
MIT License
bolt/core
Take imagelist into account for the magic image
95,144
28.03.2020 15:19:32
-3,600
1da93170a2356466d05d4936a9932daa7f595f63
Ensure we have 'slug' in API and 'getValues', even if none is set in contenttype.
[ { "change_type": "MODIFY", "old_path": "src/Entity/Content.php", "new_path": "src/Entity/Content.php", "diff": "@@ -202,6 +202,11 @@ class Content\npublic function getSlug($locale = null): ?string\n{\n+ // In case the ContentType has no slug defined, we've no other option than to use the id\n+ if (! $this->hasField('slug')) {\n+ return (string) $this->getId();\n+ }\n+\n$slug = null;\nif ($locale === null) {\n// get slug with locale the slug already has\n@@ -219,11 +224,6 @@ class Content\n->getParsedValue();\n}\n- // In case the ContentType has no slug defined, we've no other option than to use the id\n- if (! $slug) {\n- $slug = (string) $this->getId();\n- }\n-\nreturn $slug;\n}\n@@ -406,6 +406,11 @@ class Content\n$fieldValues[$field->getName()] = $field->getApiValue();\n}\n+ // Make sure we have a 'slug', even if none is defined in the contentype\n+ if (! array_key_exists('slug', $fieldValues)) {\n+ $fieldValues['slug'] = $this->getSlug();\n+ }\n+\nreturn $fieldValues;\n}\n" } ]
PHP
MIT License
bolt/core
Ensure we have 'slug' in API and 'getValues', even if none is set in contenttype.
95,144
29.03.2020 12:30:26
-7,200
113c0df2b79e8cbeb286b0e9ad20190d42ef8761
Allow `where` filtering on taxonomies in `setcontent`
[ { "change_type": "MODIFY", "old_path": "src/Storage/Directive/PrintQueryDirective.php", "new_path": "src/Storage/Directive/PrintQueryDirective.php", "diff": "@@ -14,12 +14,31 @@ class PrintQueryDirective\n{\npublic function __invoke(QueryInterface $query): void\n{\n- $output = sprintf('<code>%s</code>', $query->getQueryBuilder()->getDQL());\n+// dump($query->getQueryBuilder()->getQuery()->getSQL());\n- $output .= '<ul>';\n+ $dql = $query->getQueryBuilder()->getDQL();\n+ $parameters = $query->getQueryBuilder()->getParameters();\n+\n+ $dql = strtr($dql, [\n+ 'INNER' => \"\\nINNER\",\n+ 'WHERE' => \"\\nWHERE\",\n+ 'ORDER' => \"\\nORDER\",\n+ ]);\n/** @var Parameter $parameter */\n- foreach ($query->getQueryBuilder()->getParameters() as $parameter) {\n+ foreach ($parameters as $parameter) {\n+ $dql = str_replace(\n+ ':' . $parameter->getName() . '',\n+ '<b title=\"' . $parameter->getValue() . '\">:' . $parameter->getName() . '</b>',\n+ $dql\n+ );\n+ }\n+\n+ $output = sprintf('<code>%s</code>', $dql);\n+\n+ $output .= '<ul>';\n+\n+ foreach ($parameters as $parameter) {\n$output .= sprintf(\n'<li><code>%s</code>: <code>%s</code></li>',\n$parameter->getName(),\n" }, { "change_type": "MODIFY", "old_path": "src/Storage/Handler/SelectQueryHandler.php", "new_path": "src/Storage/Handler/SelectQueryHandler.php", "diff": "@@ -41,6 +41,7 @@ class SelectQueryHandler\n// Bolt4 introduces an extra table for field values, so additional\n// joins are required.\n$selectQuery->doReferenceJoins();\n+ $selectQuery->doTaxonomyJoins();\n$selectQuery->doFieldJoins();\n$contentQuery->runDirectives($selectQuery);\n" }, { "change_type": "MODIFY", "old_path": "src/Storage/SelectQuery.php", "new_path": "src/Storage/SelectQuery.php", "diff": "@@ -57,6 +57,9 @@ class SelectQuery implements QueryInterface\n'status',\n];\n+ /** @var array */\n+ protected $taxonomyFields = [];\n+\n/** @var array */\nprotected $referenceFields = [\n'author',\n@@ -65,6 +68,9 @@ class SelectQuery implements QueryInterface\n/** @var array */\nprivate $referenceJoins = [];\n+ /** @var array */\n+ private $taxonomyJoins = [];\n+\n/** @var array */\nprivate $fieldJoins = [];\n@@ -79,6 +85,8 @@ class SelectQuery implements QueryInterface\n$this->qb = $qb;\n$this->parser = $parser;\n$this->config = $config;\n+\n+ $this->setTaxonomyFields();\n}\n/**\n@@ -139,6 +147,7 @@ class SelectQuery implements QueryInterface\n$expr = $this->qb->expr()->andX();\n$this->referenceJoins = [];\n+ $this->taxonomyJoins = [];\n$this->fieldJoins = [];\nforeach ($this->filters as $filter) {\n@@ -146,12 +155,19 @@ class SelectQuery implements QueryInterface\n// todo: `|||` and `bolt_field` integration.\n$expr = $expr->add($filter->getExpression());\n} elseif (in_array($filter->getKey(), $this->coreFields, true)) {\n+ // For fields like `id`, `createdAt` and `status`, which are in the main `bolt_content` table\n$expr = $expr->add($filter->getExpression());\n} elseif (in_array($filter->getKey(), $this->referenceFields, true)) {\n+ // Special case for filtering on 'author'\n$this->referenceJoins[$filter->getKey()] = $filter;\n$expr = $expr->add($filter->getExpression());\n+ } elseif (in_array($filter->getKey(), $this->getTaxonomyFields(), true)) {\n+ // For when we're using a taxonomy type in the `where`\n+ $this->taxonomyJoins[$filter->getKey()] = $filter;\n+ $filterExpression = sprintf('taxonomies_%s.slug = :%s', $filter->getKey(), key($filter->getParameters()));\n+ $expr = $expr->add($filterExpression);\n} else {\n- // This means the value is stored in the `bolt_field` table\n+ // This means the name / value in the `where` is stored in the `bolt_field` table\n$this->fieldJoins[$filter->getKey()] = $filter;\n}\n}\n@@ -310,6 +326,16 @@ class SelectQuery implements QueryInterface\n}\n}\n+ /**\n+ * Allows key-value queries for `bolt_taxonomy` (slug) values.\n+ */\n+ public function doTaxonomyJoins(): void\n+ {\n+ foreach (array_keys($this->taxonomyJoins) as $key) {\n+ $this->qb->join('content.taxonomies', 'taxonomies_' . $key);\n+ }\n+ }\n+\n/**\n* Allows key-value queries for `bolt_field` values.\n*/\n@@ -370,6 +396,23 @@ class SelectQuery implements QueryInterface\n$this->qb->andWhere(implode(' OR ', $where));\n}\n+ private function setTaxonomyFields(): void\n+ {\n+ $taxos = $this->getConfig()->get('taxonomies');\n+\n+ foreach ($taxos as $taxo) {\n+ $this->taxonomyFields[] = $taxo->get('slug');\n+ $this->taxonomyFields[] = $taxo->get('singular_slug');\n+ }\n+\n+ dump($this->taxonomyFields);\n+ }\n+\n+ private function getTaxonomyFields(): array\n+ {\n+ return $this->taxonomyFields;\n+ }\n+\npublic function getIndex(): int\n{\nreturn $this->index;\n" } ]
PHP
MIT License
bolt/core
Allow `where` filtering on taxonomies in `setcontent`
95,144
29.03.2020 13:23:46
-7,200
c0567ad89e434245563eab23592c105c0440c9d9
Prepare release 4.0.0-rc.12
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "{\n\"name\": \"bolt\",\n- \"version\": \"4.0.0-rc.10\",\n+ \"version\": \"4.0.0-rc.12\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "{\n\"name\": \"bolt\",\n- \"version\": \"4.0.0-rc.10\",\n+ \"version\": \"4.0.0-rc.12\",\n\"homepage\": \"https://boltcms.io\",\n\"author\": \"Bob den Otter <bob@twokings.nl> (https://boltcms.io)\",\n\"license\": \"MIT\",\n" } ]
PHP
MIT License
bolt/core
Prepare release 4.0.0-rc.12
95,144
30.03.2020 20:03:24
-7,200
ba23e21f75f193b3d34a6e0113c5947a9effab14
Workaround for updating KnpLabs/DoctrineBehaviors, without breaking `config/bundles.php` first
[ { "change_type": "MODIFY", "old_path": "src/Kernel.php", "new_path": "src/Kernel.php", "diff": "@@ -165,3 +165,8 @@ class Kernel extends BaseKernel\nthrow new \\Exception('The Public Folder could not be determined. Expected folder `public`, `public_html`, `www`, `web`, `httpdocs`, `wwwroot`, `htdocs`, `http_public` or `private_html` to exist.');\n}\n}\n+\n+// Note: This is here to ease the upgrade from Knp/DoctrineBehaviors 2.0.1 to 2.0.2\n+// @see https://github.com/KnpLabs/DoctrineBehaviors/pull/534\n+// @deprecated since 4.0.0\n+class_alias('Knp\\DoctrineBehaviors\\DoctrineBehaviorsBundle', 'Knp\\DoctrineBehaviors\\Bundle\\DoctrineBehaviorsBundle');\n" } ]
PHP
MIT License
bolt/core
Workaround for updating KnpLabs/DoctrineBehaviors, without breaking `config/bundles.php` first
95,144
31.03.2020 18:09:42
-7,200
db30f5178bd9ff17b82f7cdb4488b78567790233
Make 'magic' titles and default sorting a bit more robust.
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/ContentTypesParser.php", "new_path": "src/Configuration/Parser/ContentTypesParser.php", "diff": "@@ -168,13 +168,18 @@ class ContentTypesParser extends BaseParser\n$contentType['order'] = $this->determineOrder($contentType);\n+ // Remove (deprecated) `sort` attribute.\n+ if (isset($contentType['sort'])) {\n+ unset($contentType['sort']);\n+ }\n+\n// Make sure title_format is set\nif (isset($contentType['title_format'])) {\n$contentType['title_format'] = (array) $contentType['title_format'];\n} elseif (isset($contentType['fields']['slug']['uses'])) {\n$contentType['title_format'] = (array) $contentType['fields']['slug']['uses'];\n} else {\n- $contentType['title_format'] = (array) key($contentType['fields']);\n+ $contentType['title_format'] = null;\n}\n// Make sure taxonomy is an array.\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -94,6 +94,7 @@ class ContentExtension extends AbstractExtension\nreturn [\nnew TwigFilter('title', [$this, 'getTitle'], $safe),\n+ new TwigFilter('title_fields', [$this, 'guessTitleFields']),\nnew TwigFilter('image', [$this, 'getImage']),\nnew TwigFilter('excerpt', [$this, 'getExcerpt'], $safe),\nnew TwigFilter('previous', [$this, 'getPreviousContent']),\n@@ -166,10 +167,12 @@ class ContentExtension extends AbstractExtension\n$titleParts[] = $content->getField($fieldName)->__toString();\n}\n- return trim(implode(' ', $titleParts));\n+ $maxLength = 80; // Should we make this configurable, or is that overkill?\n+\n+ return Html::trimText(implode(' ', $titleParts), $maxLength);\n}\n- private function guessTitleFields(Content $content): array\n+ public function guessTitleFields(Content $content): array\n{\n$definition = $content->getDefinition();\n@@ -205,6 +208,12 @@ class ContentExtension extends AbstractExtension\n}\n}\n+ foreach ($content->getFields() as $field) {\n+ if ($field instanceof Excerptable) {\n+ return (array) $field->getName();\n+ }\n+ }\n+\nreturn [];\n}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/listing.html.twig", "new_path": "templates/content/listing.html.twig", "diff": ":csrftoken=\"{{ csrf_token('batch')|json_encode }}\"\n></listing-select-box>\n- {% set titleField = contentType.title_format|first %}\n+ {# Set `titleField` and `titleLabel`, but only if we have records #}\n+ {% if records|first %}\n+ {% set titleField = records|first|title_fields|first %}\n{% set titleLabel = contentType.fields[titleField].label %}\n+ {% else %}\n+ {% set titleField = '-' %}\n+ {% set titleLabel = '-' %}\n+ {% endif %}\n{% set filterOptions = {\n'id': \"Id\", (titleField): titleLabel, 'author': 'Author', 'status': 'Status', 'createdAt': 'Created date',\n" } ]
PHP
MIT License
bolt/core
Make 'magic' titles and default sorting a bit more robust.
95,144
01.04.2020 17:28:02
-7,200
e7335250d3b382c500226213bee569b8caf1a79b
Update to knplabs/doctrine-behaviors 2.0.3
[ { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"erusev/parsedown\": \"^1.7\",\n\"ezyang/htmlpurifier\": \"^4.12\",\n\"fzaninotto/faker\": \"^1.9\",\n- \"knplabs/doctrine-behaviors\": \"^2.0\",\n+ \"knplabs/doctrine-behaviors\": \"^2.0.3\",\n\"knplabs/knp-menu-bundle\": \"^3.0\",\n\"league/glide-symfony\": \"^1.0\",\n\"miljar/php-exif\": \"^0.6.4\",\n" }, { "change_type": "MODIFY", "old_path": "src/Kernel.php", "new_path": "src/Kernel.php", "diff": "@@ -165,8 +165,3 @@ class Kernel extends BaseKernel\nthrow new \\Exception('The Public Folder could not be determined. Expected folder `public`, `public_html`, `www`, `web`, `httpdocs`, `wwwroot`, `htdocs`, `http_public` or `private_html` to exist.');\n}\n}\n-\n-// Note: This is here to ease the upgrade from Knp/DoctrineBehaviors 2.0.1 to 2.0.2\n-// @see https://github.com/KnpLabs/DoctrineBehaviors/pull/534\n-// @deprecated since 4.0.0\n-class_alias(\\Knp\\DoctrineBehaviors\\DoctrineBehaviorsBundle::class, 'Knp\\DoctrineBehaviors\\Bundle\\DoctrineBehaviorsBundle');\n" } ]
PHP
MIT License
bolt/core
Update to knplabs/doctrine-behaviors 2.0.3
95,144
01.04.2020 17:20:19
-7,200
7af373133a0decc37fac7fda5a389d66e99c585c
Better thumbnails for Image Fields
[ { "change_type": "MODIFY", "old_path": "assets/scss/vendor/baguette.scss", "new_path": "assets/scss/vendor/baguette.scss", "diff": "width: 100%;\nheight: 100%;\nz-index: 1000000;\n- background-color: transparent !important;\n+ background-color: rgba(220, 220, 220, 0.35) !important;\n+ -webkit-backdrop-filter: blur(3px);\n+\n+ backdrop-filter: blur(3px);\n&::before {\nposition: absolute;\nmax-width: 100%;\nvertical-align: middle;\nbox-shadow: $card-box-shadow;\n+ filter: drop-shadow(2px 2px 12px rgba(0, 0, 0, .2));\n}\nfigcaption {\ncolor: var(--foreground);\nfont: 1.6em sans-serif;\ntransition: background-color 0.2s ease;\n+ filter: drop-shadow(2px 2px 10px rgba(0, 0, 0, 1));\n&#next-button {\n@extend %arrow-button;\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/image.html.twig", "new_path": "templates/_partials/fields/image.html.twig", "diff": "<editor-image\n:name='{{ name|json_encode }}'\n:filename='{{ field.get('filename')|json_encode }}'\n- :thumbnail='{{ field|thumbnail(width=400, height=300)|json_encode }}'\n:media='{{ field.get('media')|json_encode }}'\n:directory='{{ directory|json_encode }}'\n:filelist='{{ filelist|json_encode }}'\n" } ]
PHP
MIT License
bolt/core
Better thumbnails for Image Fields
95,144
01.04.2020 19:46:39
-7,200
ecffe99f28ebf773190c6008f08c2dec7fdc6b0e
Don't "save" on preview
[ { "change_type": "MODIFY", "old_path": "src/Controller/Backend/ContentEditController.php", "new_path": "src/Controller/Backend/ContentEditController.php", "diff": "@@ -170,7 +170,7 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\n{\n$this->validateCsrf($request, 'editrecord');\n- $content = $this->contentFromPost($content, $request);\n+ $content = $this->contentFromPost($content, $request, true);\n$recordSlug = $content->getDefinition()->get('singular_slug');\n$context = [\n@@ -259,10 +259,9 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\nreturn new RedirectResponse($url);\n}\n- private function contentFromPost(?Content $content, Request $request): Content\n+ private function contentFromPost(?Content $content, Request $request, bool $forPreview = false): Content\n{\n$formData = $request->request->all();\n-\n$locale = $this->getPostedLocale($formData) ?: $content->getDefaultLocale();\n/** @var User $user */\n@@ -299,7 +298,7 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\n}\n}\n- $this->updateCollections($content, $formData, $locale);\n+ $this->updateCollections($content, $formData, $locale, $forPreview);\nif (isset($formData['taxonomy'])) {\nforeach ($formData['taxonomy'] as $fieldName => $taxonomy) {\n@@ -327,7 +326,7 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\n}\n}\n- private function updateCollections(Content $content, array $formData, ?string $locale): void\n+ private function updateCollections(Content $content, array $formData, ?string $locale, bool $forPreview): void\n{\n$collections = $content->getFields()->filter(function (Field $field) {\nreturn $field->getType() === CollectionField::TYPE;\n@@ -340,7 +339,11 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\n$this->removeFieldChildren($collection);\n}\n+ // We flush the entityManager here, because otherwise fields wouldn't persist properly. However, if we're\n+ // \"previewing\" we most certainly do _not_ want to do this, because we'd effectively 'save' the Record.\n+ if (! $forPreview) {\n$this->em->flush();\n+ }\nif (isset($formData['collections'])) {\nforeach ($formData['collections'] as $collectionName => $collectionItems) {\n" } ]
PHP
MIT License
bolt/core
Don't "save" on preview
95,179
01.04.2020 19:58:46
-7,200
a9d59cd6fe413b59a19378d0cd971468fa9d2a35
EM based table prefixing
[ { "change_type": "MODIFY", "old_path": "src/Doctrine/TablePrefix.php", "new_path": "src/Doctrine/TablePrefix.php", "diff": "@@ -4,33 +4,38 @@ declare(strict_types=1);\nnamespace Bolt\\Doctrine;\n-use Bolt\\Common\\Str;\nuse Doctrine\\ORM\\Event\\LoadClassMetadataEventArgs;\nuse Doctrine\\ORM\\Mapping\\ClassMetadataInfo;\n+use Symfony\\Bridge\\Doctrine\\ManagerRegistry;\nclass TablePrefix\n{\n- private $tablePrefix;\n+ use TablePrefixTrait;\n- public function __construct(string $tablePrefix)\n+ public function __construct($tablePrefixes, ManagerRegistry $managerRegistry)\n{\n- $this->tablePrefix = Str::ensureEndsWith($tablePrefix, '_');\n+ $this->setTablePrefixes($tablePrefixes, $managerRegistry);\n}\npublic function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void\n{\n+ if ($tablePrefix = $this->getTablePrefix($eventArgs->getEntityManager())) {\n$classMetadata = $eventArgs->getClassMetadata();\n- if (! $classMetadata->isInheritanceTypeSingleTable() || $classMetadata->getName() === $classMetadata->rootEntityName) {\n- $classMetadata->setPrimaryTable([\n- 'name' => $this->tablePrefix . $classMetadata->getTableName(),\n- ]);\n+ if (!$classMetadata->isInheritanceTypeSingleTable()\n+ || $classMetadata->getName() === $classMetadata->rootEntityName) {\n+ $classMetadata->setPrimaryTable(\n+ [\n+ 'name' => $tablePrefix.$classMetadata->getTableName(),\n+ ]\n+ );\n}\nforeach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {\nif ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && $mapping['isOwningSide']) {\n$mappedTableName = $mapping['joinTable']['name'];\n- $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->tablePrefix . $mappedTableName;\n+ $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $tablePrefix.$mappedTableName;\n+ }\n}\n}\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Doctrine/TablePrefixTrait.php", "diff": "+<?php\n+/**\n+ * @author Rix Beck <rix@neologik.hu>\n+ */\n+\n+namespace Bolt\\Doctrine;\n+\n+use Bolt\\Common\\Str;\n+use Doctrine\\Persistence\\ObjectManager;\n+use Symfony\\Bridge\\Doctrine\\ManagerRegistry;\n+\n+trait TablePrefixTrait\n+{\n+ private $tablePrefixes = [];\n+\n+ protected function setTablePrefix(ObjectManager $manager, string $prefix)\n+ {\n+ $key = spl_object_hash($manager);\n+ $this->tablePrefixes[$key] = Str::ensureEndsWith($prefix, '_');\n+\n+ return $this;\n+ }\n+\n+ protected function setTablePrefixes($tablePrefixes, ManagerRegistry $managerRegistry)\n+ {\n+ $prefixes = (array)$tablePrefixes;\n+ $this->registry = $managerRegistry;\n+\n+ foreach ($prefixes as $em => $tablePrefix) {\n+ $manager = $managerRegistry->getManager(is_int($em) ? 'default' : $em);\n+ if ($manager) {\n+ $this->setTablePrefix($manager, $tablePrefix);\n+ }\n+ }\n+\n+ return $this;\n+ }\n+\n+ protected function getTablePrefix(ObjectManager $manager)\n+ {\n+ $key = spl_object_hash($manager);\n+\n+ return $this->tablePrefixes[$key] ?? '';\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/Event/Subscriber/TimedPublishSubscriber.php", "new_path": "src/Event/Subscriber/TimedPublishSubscriber.php", "diff": "@@ -4,14 +4,17 @@ declare(strict_types=1);\nnamespace Bolt\\Event\\Subscriber;\n-use Bolt\\Common\\Str;\n+use Bolt\\Doctrine\\TablePrefixTrait;\nuse Carbon\\Carbon;\nuse Doctrine\\ORM\\EntityManagerInterface;\n+use Symfony\\Bridge\\Doctrine\\ManagerRegistry;\nuse Symfony\\Component\\EventDispatcher\\EventSubscriberInterface;\nuse Symfony\\Component\\HttpKernel\\KernelEvents;\nclass TimedPublishSubscriber implements EventSubscriberInterface\n{\n+ use TablePrefixTrait;\n+\npublic const PRIORITY = 30;\n/** @var EntityManagerInterface */\n@@ -20,10 +23,22 @@ class TimedPublishSubscriber implements EventSubscriberInterface\n/** @var string */\nprivate $tablePrefix;\n- public function __construct(string $tablePrefix, EntityManagerInterface $entityManager)\n+ public function __construct($tablePrefixes, ManagerRegistry $managerRegistry)\n{\n- $this->entityManager = $entityManager;\n- $this->tablePrefix = Str::ensureEndsWith($tablePrefix, '_');\n+ $this->entityManager = $managerRegistry->getManager('default');\n+ $this->tablePrefix = $this\n+ ->setTablePrefixes($tablePrefixes, $managerRegistry)\n+ ->getTablePrefix($this->entityManager);\n+ }\n+\n+ /**\n+ * Return the events to subscribe to.\n+ */\n+ public static function getSubscribedEvents(): array\n+ {\n+ return [\n+ KernelEvents::REQUEST => [['onKernelRequest', self::PRIORITY]], // Right after route is matched\n+ ];\n}\n/**\n@@ -36,8 +51,14 @@ class TimedPublishSubscriber implements EventSubscriberInterface\n// Publish timed Content records when 'publish_at' has passed and Depublish published Content\n// records when 'depublish_at' has passed. Note: Placeholders in DBAL don't work for tablenames.\n- $queryPublish = sprintf('update %scontent SET status = \"published\", published_at = :now WHERE status = \"timed\" AND published_at < :now', $this->tablePrefix);\n- $queryDepublish = sprintf('update %scontent SET status = \"held\", depublished_at = :now WHERE status = \"published\" AND depublished_at < :now', $this->tablePrefix);\n+ $queryPublish = sprintf(\n+ 'update %scontent SET status = \"published\", published_at = :now WHERE status = \"timed\" AND published_at < :now',\n+ $this->tablePrefix\n+ );\n+ $queryDepublish = sprintf(\n+ 'update %scontent SET status = \"held\", depublished_at = :now WHERE status = \"published\" AND depublished_at < :now',\n+ $this->tablePrefix\n+ );\ntry {\n$conn->executeUpdate($queryPublish, [':now' => $now]);\n@@ -46,14 +67,4 @@ class TimedPublishSubscriber implements EventSubscriberInterface\n// Fail silently, output user-friendly exception elsewhere.\n}\n}\n-\n- /**\n- * Return the events to subscribe to.\n- */\n- public static function getSubscribedEvents(): array\n- {\n- return [\n- KernelEvents::REQUEST => [['onKernelRequest', self::PRIORITY]], // Right after route is matched\n- ];\n- }\n}\n" } ]
PHP
MIT License
bolt/core
EM based table prefixing
95,179
01.04.2020 20:12:49
-7,200
d5c8cef098db6d900dee7edaf4e3957fc8fbbc37
Change to right service parameter type for autowiring
[ { "change_type": "MODIFY", "old_path": "src/Doctrine/TablePrefix.php", "new_path": "src/Doctrine/TablePrefix.php", "diff": "@@ -6,7 +6,7 @@ namespace Bolt\\Doctrine;\nuse Doctrine\\ORM\\Event\\LoadClassMetadataEventArgs;\nuse Doctrine\\ORM\\Mapping\\ClassMetadataInfo;\n-use Symfony\\Bridge\\Doctrine\\ManagerRegistry;\n+use Doctrine\\Persistence\\ManagerRegistry;\nclass TablePrefix\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Doctrine/TablePrefixTrait.php", "new_path": "src/Doctrine/TablePrefixTrait.php", "diff": "namespace Bolt\\Doctrine;\nuse Bolt\\Common\\Str;\n+use Doctrine\\Persistence\\ManagerRegistry;\nuse Doctrine\\Persistence\\ObjectManager;\n-use Symfony\\Bridge\\Doctrine\\ManagerRegistry;\ntrait TablePrefixTrait\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Event/Subscriber/TimedPublishSubscriber.php", "new_path": "src/Event/Subscriber/TimedPublishSubscriber.php", "diff": "@@ -7,7 +7,7 @@ namespace Bolt\\Event\\Subscriber;\nuse Bolt\\Doctrine\\TablePrefixTrait;\nuse Carbon\\Carbon;\nuse Doctrine\\ORM\\EntityManagerInterface;\n-use Symfony\\Bridge\\Doctrine\\ManagerRegistry;\n+use Doctrine\\Persistence\\ManagerRegistry;\nuse Symfony\\Component\\EventDispatcher\\EventSubscriberInterface;\nuse Symfony\\Component\\HttpKernel\\KernelEvents;\n" } ]
PHP
MIT License
bolt/core
Change to right service parameter type for autowiring
95,179
01.04.2020 20:13:39
-7,200
838ec95324001bacadec7475fd91d5f08b1fd41e
Using argument scalars
[ { "change_type": "MODIFY", "old_path": "config/services.yaml", "new_path": "config/services.yaml", "diff": "@@ -5,7 +5,8 @@ parameters:\n# This parameter defines the codes of the locales (languages) enabled in the application\napp_locales: en|nl|es|fr|de|pl|it|hu|pt_BR|ja|nb|nn|nl_NL|nl_BE|is|ru\napp.notifications.email_sender: anonymous@example.com\n- bolt.table_prefix: bolt_\n+ app.table_prefix:\n+ default: bolt_\nbolt.backend_url: /bolt\nservices:\n@@ -21,7 +22,7 @@ services:\n$emailSender: '%app.notifications.email_sender%'\n$projectDir: '%kernel.project_dir%'\n$publicFolder: '%bolt.public_folder%'\n- $tablePrefix: '%bolt.table_prefix%'\n+ $tablePrefixes: '%app.table_prefix%'\n# makes classes in src/ available to be used as services\n# this creates a service per class whose id is the fully-qualified class name\n" } ]
PHP
MIT License
bolt/core
Using argument scalars
95,179
02.04.2020 10:44:06
-7,200
396d6b3f489d3e52106aab844ca8d6d03a648bd8
Commenting with table prefix usage
[ { "change_type": "MODIFY", "old_path": "config/services.yaml", "new_path": "config/services.yaml", "diff": "@@ -5,8 +5,12 @@ parameters:\n# This parameter defines the codes of the locales (languages) enabled in the application\napp_locales: en|nl|es|fr|de|pl|it|hu|pt_BR|ja|nb|nn|nl_NL|nl_BE|is|ru\napp.notifications.email_sender: anonymous@example.com\n- app.table_prefix:\n- default: bolt_\n+ # Default table prefix for Bolt database\n+ app.table_prefix: bolt_\n+ # Alternatively may define different table prefixes by entity managers configured in doctrine.yml\n+ # app.table_prefix:\n+ # default: bolt_\n+ # foo_manager: foo_\nbolt.backend_url: /bolt\nservices:\n" } ]
PHP
MIT License
bolt/core
Commenting with table prefix usage
95,144
02.04.2020 19:31:41
-7,200
21080c6074eca7196beebe81cc4a1da6fd8f2c82
Ninja-edit for "view saved on site" button
[ { "change_type": "MODIFY", "old_path": "templates/content/_buttons.html.twig", "new_path": "templates/content/_buttons.html.twig", "diff": "{% if record.id %}\n<div class=\"btn-group\">\n-\n{{ macro.button(\n'action.preview',\n'fa-external-link-square-alt',\n'formtarget': '_blank',\n'formaction': path('bolt_content_edit_preview', {'id': record.id })\n}) }}\n-\n</div>\n{% if record.status == \"published\" %}\n- <div>\n- <strong>{{ 'action.view_saved'|trans }}</strong><br>\n- <a href=\"{{ record|link(true) }}\" target=\"_blank\">{{ record|link(true)|trim('https://', side='left') }}</a>\n+ <div class=\"form-fieldsgroup__summary-fields\">\n+ <a href=\"{{ record|link(true) }}\" target=\"_blank\">{{ macro.icon('fa-sign-out-alt') }} {{ 'action.view_saved'|trans }}</a>\n</div>\n{% endif %}\n" } ]
PHP
MIT License
bolt/core
Ninja-edit for "view saved on site" button
95,144
03.04.2020 17:54:30
-7,200
a8effe2c60e3543e92147c09197f46a0d6c2eb0a
Minor tweaks to the "View Translations" page.
[ { "change_type": "MODIFY", "old_path": "templates/_partials/fields/_label.html.twig", "new_path": "templates/_partials/fields/_label.html.twig", "diff": "+{% import '@bolt/_macro/_macro.html.twig' as macro %}\n+\n{%- if type|default() != 'checkbox' -%}\n- <label for=\"{{ id }}\" class=\"editor--label{% if type|default() == 'collection' %} sr-only{% endif %}\">\n{%- if localize|default() -%}\n- <i class=\"fas fa-language\"></i>\n+ <span style=\"color: #999; font-size: 140%; line-height: 0;\" class=\"float-right\" title=\"{{ __('label.translatable') }}\">{{ macro.icon('language') }}</span>\n{%- endif -%}\n+ <label for=\"{{ id }}\" class=\"editor--label{% if type|default() == 'collection' %} sr-only{% endif %}\">\n+\n{% if in_collection is defined %}\n<span style=\"font-weight: normal;\">{{ collection_label }} &raquo;</span>\n{% endif %}\n" }, { "change_type": "MODIFY", "old_path": "translations/messages.en.xlf", "new_path": "translations/messages.en.xlf", "diff": "<target>Saving is disabled, because the target file is not writable.</target>\n</segment>\n</unit>\n+ <unit id=\"hAysbHB\" name=\"label.translatable\">\n+ <segment>\n+ <source>label.translatable</source>\n+ <target>This field is translatable</target>\n+ </segment>\n+ </unit>\n</file>\n</xliff>\n" }, { "change_type": "MODIFY", "old_path": "translations/messages.nl.xlf", "new_path": "translations/messages.nl.xlf", "diff": "<unit id=\"37kJiIe\" name=\"view_locales.badge_default\">\n<segment>\n<source>view_locales.badge_default</source>\n- <target>__view_locales.badge_default</target>\n+ <target>Standaard</target>\n</segment>\n</unit>\n<unit id=\"JTRCo_U\" name=\"view_locales.badge_ok\">\n<target>Sessie verloopt</target>\n</segment>\n</unit>\n+ <unit id=\"hAysbHB\" name=\"label.translatable\">\n+ <segment>\n+ <source>label.translatable</source>\n+ <target>Dit veld is vertaalbaar</target>\n+ </segment>\n+ </unit>\n+ <unit id=\"XQ2U6fN\" name=\"slug.button_unlocked\">\n+ <segment>\n+ <source>slug.button_unlocked</source>\n+ <target>Van slot</target>\n+ </segment>\n+ </unit>\n</file>\n</xliff>\n" } ]
PHP
MIT License
bolt/core
Minor tweaks to the "View Translations" page.
95,144
04.04.2020 12:22:11
-7,200
41dca3dcbaaea2c8a22873f8a626b53cdf8b9c09
Move the check for JSON to Doctrine/Version class
[ { "change_type": "MODIFY", "old_path": "src/Command/InfoCommand.php", "new_path": "src/Command/InfoCommand.php", "diff": "@@ -55,14 +55,13 @@ HELP\n$io->text([$message, '']);\n$platform = $this->doctrineVersion->getPlatform();\n-\n$connection = ! empty($platform['connection_status']) ? sprintf(' - <comment>%s</comment>', $platform['connection_status']) : '';\n-\n$tableExists = $this->doctrineVersion->tableContentExists() ? '' : sprintf(' - <error>Tables not initialised</error>');\n+ $withJson = $this->doctrineVersion->hasJson() ? 'with JSON' : 'without JSON';\n$io->listing([\nsprintf('Install type: <info>%s</info>', Version::installType()),\n- sprintf('Database: <info>%s %s</info> %s %s', $platform['driver_name'], $platform['server_version'], $connection, $tableExists),\n+ sprintf('Database: <info>%s %s</info>%s%s <info>(%s)</info>', $platform['driver_name'], $platform['server_version'], $connection, $tableExists, $withJson),\nsprintf('PHP version: <info>%s</info>', PHP_VERSION),\nsprintf('Operating System: <info>%s</info> - <comment>%s</comment>', php_uname('s'), php_uname('r')),\n]);\n" }, { "change_type": "MODIFY", "old_path": "src/Repository/ContentRepository.php", "new_path": "src/Repository/ContentRepository.php", "diff": "@@ -127,8 +127,9 @@ class ContentRepository extends ServiceEntityRepository\npublic function findOneBySlug(string $slug, ?ContentType $contentType = null): ?Content\n{\n$qb = $this->getQueryBuilder();\n+ $connection = $qb->getEntityManager()->getConnection();\n- [$where, $slug] = JsonHelper::wrapJsonFunction('translations.value', $slug, $qb);\n+ [$where, $slug] = JsonHelper::wrapJsonFunction('translations.value', $slug, $connection);\n$query = $qb\n->innerJoin('content.fields', 'field')\n@@ -155,8 +156,9 @@ class ContentRepository extends ServiceEntityRepository\npublic function findOneByFieldValue(string $fieldName, string $value, ?ContentType $contentType = null): ?Content\n{\n$qb = $this->getQueryBuilder();\n+ $connection = $qb->getEntityManager()->getConnection();\n- [$where, $value] = JsonHelper::wrapJsonFunction('translation.value', $value, $qb);\n+ [$where, $value] = JsonHelper::wrapJsonFunction('translation.value', $value, $connection);\n$query = $qb\n->innerJoin('content.fields', 'field')\n" }, { "change_type": "MODIFY", "old_path": "src/Repository/FieldRepository.php", "new_path": "src/Repository/FieldRepository.php", "diff": "@@ -32,8 +32,9 @@ class FieldRepository extends ServiceEntityRepository\npublic function findOneBySlug(string $slug): ?Field\n{\n$qb = $this->getQueryBuilder();\n+ $connection = $qb->getEntityManager()->getConnection();\n- [$where, $slug] = JsonHelper::wrapJsonFunction('translations.value', $slug, $qb);\n+ [$where, $slug] = JsonHelper::wrapJsonFunction('translations.value', $slug, $connection);\nreturn $qb\n->innerJoin('field.translations', 'translations')\n" }, { "change_type": "MODIFY", "old_path": "src/Storage/SelectQuery.php", "new_path": "src/Storage/SelectQuery.php", "diff": "@@ -352,7 +352,7 @@ class SelectQuery implements QueryInterface\n$originalLeftExpression = 'content.' . $key;\n- $newLeftExpression = JsonHelper::wrapJsonFunction($translationsAlias . '.value', null, $this->qb);\n+ $newLeftExpression = JsonHelper::wrapJsonFunction($translationsAlias . '.value', null, $em->getConnection());\n$where = $filter->getExpression();\n$where = str_replace($originalLeftExpression, $newLeftExpression, $where);\n@@ -377,7 +377,7 @@ class SelectQuery implements QueryInterface\n->andWhere($this->qb->expr()->in('content.id', $innerQuery->getDQL()));\nforeach ($filter->getParameters() as $key => $value) {\n- $value = JsonHelper::wrapJsonFunction(null, $value, $this->qb);\n+ $value = JsonHelper::wrapJsonFunction(null, $value, $em->getConnection());\n$this->qb->setParameter($key, $value);\n}\n}\n" } ]
PHP
MIT License
bolt/core
Move the check for JSON to Doctrine/Version class
95,144
04.04.2020 12:42:04
-7,200
e4dabd61e159b45afa41519b5dc3459ff53a32f0
Don't break if field is not initialised
[ { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -233,7 +233,7 @@ class ContentExtension extends AbstractExtension\nif ($field instanceof ImagelistField) {\n$firstImage = current($field->getValue());\n- if ($firstImage->get('filename')) {\n+ if ($firstImage && $firstImage->get('filename')) {\nreturn $onlyValues ? $firstImage->getValue() : $firstImage;\n}\n}\n" } ]
PHP
MIT License
bolt/core
Don't break if field is not initialised
95,179
04.04.2020 15:43:23
-7,200
88257f44235515fead3336fe108448a168315c50
Fix my type mess made before
[ { "change_type": "MODIFY", "old_path": "src/Event/Subscriber/TimedPublishSubscriber.php", "new_path": "src/Event/Subscriber/TimedPublishSubscriber.php", "diff": "@@ -5,8 +5,8 @@ declare(strict_types=1);\nnamespace Bolt\\Event\\Subscriber;\nuse Bolt\\Doctrine\\TablePrefixTrait;\n+use Bolt\\Entity\\Content;\nuse Carbon\\Carbon;\n-use Doctrine\\ORM\\EntityManagerInterface;\nuse Doctrine\\Persistence\\ManagerRegistry;\nuse Symfony\\Component\\EventDispatcher\\EventSubscriberInterface;\nuse Symfony\\Component\\HttpKernel\\KernelEvents;\n@@ -17,28 +17,18 @@ class TimedPublishSubscriber implements EventSubscriberInterface\npublic const PRIORITY = 30;\n- /** @var EntityManagerInterface */\n- private $entityManager;\n+ /** @var object */\n+ private $defaultConnection;\n/** @var string */\nprivate $tablePrefix;\n- public function __construct($tablePrefixes, ManagerRegistry $managerRegistry)\n+ public function __construct($tablePrefix, ManagerRegistry $managerRegistry)\n{\n- $this->entityManager = $managerRegistry->getManager('default');\n+ $this->defaultConnection = $managerRegistry->getConnection('default');\n$this->tablePrefix = $this\n- ->setTablePrefixes($tablePrefixes, $managerRegistry)\n- ->getTablePrefix($this->entityManager);\n- }\n-\n- /**\n- * Return the events to subscribe to.\n- */\n- public static function getSubscribedEvents(): array\n- {\n- return [\n- KernelEvents::REQUEST => [['onKernelRequest', self::PRIORITY]], // Right after route is matched\n- ];\n+ ->setTablePrefixes($tablePrefix, $managerRegistry)\n+ ->getTablePrefix($managerRegistry->getManager('default'));\n}\n/**\n@@ -46,7 +36,7 @@ class TimedPublishSubscriber implements EventSubscriberInterface\n*/\npublic function onKernelRequest(): void\n{\n- $conn = $this->entityManager->getConnection();\n+ $conn = $this->defaultConnection;\n$now = (new Carbon())->tz('UTC');\n// Publish timed Content records when 'publish_at' has passed and Depublish published Content\n@@ -67,4 +57,14 @@ class TimedPublishSubscriber implements EventSubscriberInterface\n// Fail silently, output user-friendly exception elsewhere.\n}\n}\n+\n+ /**\n+ * Return the events to subscribe to.\n+ */\n+ public static function getSubscribedEvents(): array\n+ {\n+ return [\n+ KernelEvents::REQUEST => [['onKernelRequest', self::PRIORITY]], // Right after route is matched\n+ ];\n+ }\n}\n" } ]
PHP
MIT License
bolt/core
Fix my type mess made before
95,144
04.04.2020 15:44:29
-7,200
5dcafb4725b2f443352278a5af5f98b730e6c065
Add Event for operations on Content. Clear cache for menu's. Log save after editing content.
[ { "change_type": "MODIFY", "old_path": "src/Controller/Backend/ContentEditController.php", "new_path": "src/Controller/Backend/ContentEditController.php", "diff": "@@ -16,6 +16,7 @@ use Bolt\\Entity\\FieldParentInterface;\nuse Bolt\\Entity\\Relation;\nuse Bolt\\Entity\\User;\nuse Bolt\\Enum\\Statuses;\n+use Bolt\\Event\\ContentEvent;\nuse Bolt\\Event\\Listener\\ContentFillListener;\nuse Bolt\\Repository\\ContentRepository;\nuse Bolt\\Repository\\FieldRepository;\n@@ -27,12 +28,14 @@ use Bolt\\Utils\\TranslationsManager;\nuse Carbon\\Carbon;\nuse Doctrine\\ORM\\EntityManagerInterface;\nuse Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Security;\n+use Symfony\\Component\\EventDispatcher\\EventDispatcher;\nuse Symfony\\Component\\HttpFoundation\\RedirectResponse;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Component\\Routing\\Annotation\\Route;\nuse Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface;\nuse Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface;\n+use Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface;\nuse Tightenco\\Collect\\Support\\Collection;\n/**\n@@ -66,6 +69,9 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\n/** @var ContentFillListener */\nprivate $contentFillListener;\n+ /** @var EventDispatcher */\n+ private $dispatcher;\n+\npublic function __construct(\nTaxonomyRepository $taxonomyRepository,\nRelationRepository $relationRepository,\n@@ -75,7 +81,8 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\nUrlGeneratorInterface $urlGenerator,\nContentFillListener $contentFillListener,\nTemplateChooser $templateChooser,\n- CsrfTokenManagerInterface $csrfTokenManager\n+ CsrfTokenManagerInterface $csrfTokenManager,\n+ EventDispatcherInterface $dispatcher\n) {\n$this->taxonomyRepository = $taxonomyRepository;\n$this->relationRepository = $relationRepository;\n@@ -86,6 +93,7 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\n$this->contentFillListener = $contentFillListener;\n$this->templateChooser = $templateChooser;\n$this->csrfTokenManager = $csrfTokenManager;\n+ $this->dispatcher = $dispatcher;\n}\n/**\n@@ -114,6 +122,9 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\n*/\npublic function edit(Request $request, Content $content): Response\n{\n+ $event = new ContentEvent($content);\n+ $this->dispatcher->dispatch($event, ContentEvent::ON_EDIT);\n+\n$twigvars = [\n'record' => $content,\n'locales' => $content->getLocales(),\n@@ -132,6 +143,9 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\n$content = $this->contentFromPost($content, $request);\n+ $event = new ContentEvent($content);\n+ $this->dispatcher->dispatch($event, ContentEvent::PRE_SAVE);\n+\n$this->em->persist($content);\n$this->em->flush();\n@@ -143,6 +157,9 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\n];\n$url = $this->urlGenerator->generate('bolt_content_edit', $urlParams);\n+ $event = new ContentEvent($content);\n+ $this->dispatcher->dispatch($event, ContentEvent::POST_SAVE);\n+\nreturn new RedirectResponse($url);\n}\n@@ -156,6 +173,9 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\n$content = $this->contentFromPost($content, $request);\n$recordSlug = $content->getDefinition()->get('singular_slug');\n+ $event = new ContentEvent($content);\n+ $this->dispatcher->dispatch($event, ContentEvent::ON_PREVIEW);\n+\n$context = [\n'record' => $content,\n$recordSlug => $content,\n@@ -181,6 +201,9 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\n$content->setDepublishedAt(null);\n$content->setPublishedAt(null);\n+ $event = new ContentEvent($content);\n+ $this->dispatcher->dispatch($event, ContentEvent::ON_DUPLICATE);\n+\n$twigvars = [\n'record' => $content,\n'locales' => $content->getLocales(),\n@@ -210,6 +233,9 @@ class ContentEditController extends TwigAwareController implements BackendZoneIn\n$content->setStatus($request->get('status'));\n+ $event = new ContentEvent($content);\n+ $this->dispatcher->dispatch($event, ContentEvent::PRE_STATUS_CHANGE);\n+\n$this->em->persist($content);\n$this->em->flush();\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Log.php", "new_path": "src/Entity/Log.php", "diff": "@@ -71,6 +71,10 @@ class Log\npublic function onPrePersist(): void\n{\n$this->createdAt = new \\DateTime();\n+\n+ if (array_key_exists('content_id', $this->getContext())) {\n+ $this->setContent($this->getContext()['content_id']);\n+ }\n}\npublic function getId(): int\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Event/ContentEvent.php", "diff": "+<?php\n+\n+declare(strict_types=1);\n+\n+namespace Bolt\\Event;\n+\n+use Bolt\\Entity\\Content;\n+use Symfony\\Contracts\\EventDispatcher\\Event;\n+\n+class ContentEvent extends Event\n+{\n+ public const PRE_SAVE = 'bolt.pre_save';\n+ public const POST_SAVE = 'bolt.post_save';\n+ public const ON_EDIT = 'bolt.pre_edit';\n+ public const ON_PREVIEW = 'bolt.pre_edit';\n+ public const ON_DUPLICATE = 'bolt.on_duplicate';\n+ public const PRE_STATUS_CHANGE = 'bolt.pre_status_change';\n+\n+ /** @var Content */\n+ private $content;\n+\n+ public function __construct(Content $content)\n+ {\n+ $this->content = $content;\n+ }\n+\n+ public function getContent(): Content\n+ {\n+ return $this->content;\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "translations/messages.en.xlf", "new_path": "translations/messages.en.xlf", "diff": "<target>This field is translatable</target>\n</segment>\n</unit>\n+ <unit id=\"qqpGLJl\" name=\"label.content\">\n+ <segment>\n+ <source>label.content</source>\n+ <target>Content</target>\n+ </segment>\n+ </unit>\n</file>\n</xliff>\n" } ]
PHP
MIT License
bolt/core
Add Event for operations on Content. Clear cache for menu's. Log save after editing content.
95,179
04.04.2020 15:45:49
-7,200
10b476371c9c9ae28a5a29d5cf145a574cb9a9e9
manual reverting parameters for bc
[ { "change_type": "MODIFY", "old_path": "config/services.yaml", "new_path": "config/services.yaml", "diff": "@@ -6,7 +6,7 @@ parameters:\napp_locales: en|nl|es|fr|de|pl|it|hu|pt_BR|ja|nb|nn|nl_NL|nl_BE|is|ru\napp.notifications.email_sender: anonymous@example.com\n# Default table prefix for Bolt database\n- app.table_prefix: bolt_\n+ bolt.table_prefix: bolt_\n# Alternatively may define different table prefixes by entity managers configured in doctrine.yml\n# app.table_prefix:\n# default: bolt_\n@@ -26,7 +26,7 @@ services:\n$emailSender: '%app.notifications.email_sender%'\n$projectDir: '%kernel.project_dir%'\n$publicFolder: '%bolt.public_folder%'\n- $tablePrefixes: '%app.table_prefix%'\n+ $tablePrefix: '%bolt.table_prefix%'\n# makes classes in src/ available to be used as services\n# this creates a service per class whose id is the fully-qualified class name\n" }, { "change_type": "MODIFY", "old_path": "src/Doctrine/TablePrefix.php", "new_path": "src/Doctrine/TablePrefix.php", "diff": "@@ -12,9 +12,9 @@ class TablePrefix\n{\nuse TablePrefixTrait;\n- public function __construct($tablePrefixes, ManagerRegistry $managerRegistry)\n+ public function __construct($tablePrefix, ManagerRegistry $managerRegistry)\n{\n- $this->setTablePrefixes($tablePrefixes, $managerRegistry);\n+ $this->setTablePrefixes($tablePrefix, $managerRegistry);\n}\npublic function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void\n" } ]
PHP
MIT License
bolt/core
manual reverting parameters for bc
95,144
05.04.2020 16:08:43
-7,200
ca1423a21a90473d8e530c57f6fee5cb3429f016
Add initial support for `allow_twig: true`
[ { "change_type": "MODIFY", "old_path": "config/bolt/contenttypes.yaml", "new_path": "config/bolt/contenttypes.yaml", "diff": "@@ -301,6 +301,7 @@ blocks:\ncontent:\ntype: html\nheight: 150px\n+ allow_twig: true\ncontent_link:\ntype: text\nlabel: Link\n@@ -312,7 +313,7 @@ blocks:\norder: title\nlabel: Select a page\nshow_on_dashboard: true\n- viewless: true\n+ viewless: false\nsearchable: false\nicon_many: \"fa:cubes\"\nicon_one: \"fa:cube\"\n" }, { "change_type": "MODIFY", "old_path": "public/theme/skeleton/record.twig", "new_path": "public/theme/skeleton/record.twig", "diff": "{% include 'partials/_image.twig' with ({'image': record|image}) %}\n+{# {{ record|allow_twig }}#}\n+\n+ {{ dump(record|title) }}\n+\n{# Output all fields, in the order as defined in the content type.\nTo change the generated html and configure the options, see:\nhttps://docs.bolt.cm/templating #}\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Content.php", "new_path": "src/Entity/Content.php", "diff": "@@ -17,6 +17,7 @@ use Doctrine\\ORM\\Mapping as ORM;\nuse Symfony\\Component\\Serializer\\Annotation\\Groups;\nuse Symfony\\Component\\Serializer\\Annotation\\MaxDepth;\nuse Tightenco\\Collect\\Support\\Collection as LaravelCollection;\n+use Twig\\Environment;\n/**\n* @ApiResource(\n@@ -122,11 +123,6 @@ class Content\n*/\nprivate $fields;\n- /**\n- * @var ContentType|null\n- */\n- private $contentTypeDefinition;\n-\n/**\n* @var Collection|Taxonomy[]\n* @MaxDepth(1)\n@@ -135,6 +131,12 @@ class Content\n*/\nprivate $taxonomies;\n+ /** @var ContentType|null */\n+ private $contentTypeDefinition = null;\n+\n+ /** @var Environment */\n+ private $twig = null;\n+\npublic function __construct(?ContentType $contentTypeDefinition = null)\n{\n$this->createdAt = new \\DateTime();\n@@ -188,6 +190,16 @@ class Content\n});\n}\n+ public function setTwig(Environment $twig): void\n+ {\n+ $this->twig = $twig;\n+ }\n+\n+ public function getTwig(): ?Environment\n+ {\n+ return $this->twig;\n+ }\n+\npublic function setDefinition(ContentType $contentType): void\n{\n$this->contentTypeDefinition = $contentType;\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/ContentExtrasTrait.php", "new_path": "src/Entity/ContentExtrasTrait.php", "diff": "@@ -12,9 +12,7 @@ use Symfony\\Component\\Serializer\\Annotation\\Groups;\n*/\ntrait ContentExtrasTrait\n{\n- /**\n- * @var ContentExtension\n- */\n+ /** @var ContentExtension */\nprivate $contentExtension;\npublic function setContentExtension(ContentExtension $contentExtension): void\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Field.php", "new_path": "src/Entity/Field.php", "diff": "@@ -9,6 +9,7 @@ use ApiPlatform\\Core\\Annotation\\ApiResource;\nuse ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Filter\\SearchFilter;\nuse Bolt\\Configuration\\Content\\FieldType;\nuse Bolt\\Utils\\Sanitiser;\n+use Bolt\\Widget\\TwigTrait;\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Knp\\DoctrineBehaviors\\Contract\\Entity\\TranslatableInterface;\nuse Knp\\DoctrineBehaviors\\Model\\Translatable\\TranslatableTrait;\n@@ -38,6 +39,7 @@ use Twig\\Markup;\nclass Field implements FieldInterface, TranslatableInterface\n{\nuse TranslatableTrait;\n+ use TwigTrait;\npublic const TYPE = 'generic';\n@@ -234,6 +236,20 @@ class Field implements FieldInterface, TranslatableInterface\n$value = $sanitiser->clean($value);\n}\n+ if (is_string($value) && $this->getDefinition()->get('allow_twig')) {\n+ $twig = $this->getTwig();\n+\n+ if ($twig) {\n+ $template = $twig->createTemplate($value);\n+ $value = $template->render();\n+ } else {\n+ $value = sprintf(\n+ '<div style=\"background: #fff3d4 !important; border-left-color: #A46A1F !important; border-left-width: 5px !important; border-left-style: solid !important; font-size: 16px !important; padding: 1rem !important; margin: 1rem 0 !important; line-height: 2.4rem !important; font-weight: normal !important;\">%s</div>',\n+ 'Tried to render field <code>' . $this->getName() . '</code> as Twig, but the Twig Environment is not available. Add <code>{{ record|allow_twig }}</code> to your template, to allow Twig Rendering for this Record.'\n+ );\n+ }\n+ }\n+\nif (is_string($value) && $this->getDefinition()->get('allow_html')) {\n$value = new Markup($value, 'UTF-8');\n}\n@@ -241,6 +257,13 @@ class Field implements FieldInterface, TranslatableInterface\nreturn $value;\n}\n+ public function getTwig()\n+ {\n+ if ($this->getContent()->getTwig()) {\n+ return $this->getContent()->getTwig();\n+ }\n+ }\n+\npublic function set(string $key, $value): self\n{\n$this->translate($this->getCurrentLocale(), ! $this->isTranslatable())->set($key, $value);\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -104,6 +104,7 @@ class ContentExtension extends AbstractExtension\nnew TwigFilter('edit_link', [$this, 'getEditLink']),\nnew TwigFilter('taxonomies', [$this, 'getTaxonomies']),\nnew TwigFilter('has_path', [$this, 'hasPath']),\n+ new TwigFilter('allow_twig', [$this, 'allowTwig'], $env),\n];\n}\n@@ -332,6 +333,11 @@ class ContentExtension extends AbstractExtension\n$recordParams['contentTypeSlug'] === $routeParams['contentTypeSlug'];\n}\n+ public function allowTwig(Environment $env, Content $content): void\n+ {\n+ $content->setTwig($env);\n+ }\n+\npublic function getLink(Content $content, bool $canonical = false): ?string\n{\nif ($content->getId() === null || $content->getDefinition()->get('viewless')) {\n" } ]
PHP
MIT License
bolt/core
Add initial support for `allow_twig: true`
95,144
05.04.2020 16:14:29
-7,200
6f661b8e15d498256277b898f42d2afee2a0e684
Don't use Twigtrait here
[ { "change_type": "MODIFY", "old_path": "src/Entity/Field.php", "new_path": "src/Entity/Field.php", "diff": "@@ -9,7 +9,6 @@ use ApiPlatform\\Core\\Annotation\\ApiResource;\nuse ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Filter\\SearchFilter;\nuse Bolt\\Configuration\\Content\\FieldType;\nuse Bolt\\Utils\\Sanitiser;\n-use Bolt\\Widget\\TwigTrait;\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Knp\\DoctrineBehaviors\\Contract\\Entity\\TranslatableInterface;\nuse Knp\\DoctrineBehaviors\\Model\\Translatable\\TranslatableTrait;\n@@ -39,7 +38,6 @@ use Twig\\Markup;\nclass Field implements FieldInterface, TranslatableInterface\n{\nuse TranslatableTrait;\n- use TwigTrait;\npublic const TYPE = 'generic';\n" } ]
PHP
MIT License
bolt/core
Don't use Twigtrait here
95,144
05.04.2020 19:06:07
-7,200
f5c928a946d93de50d00493dd8a8f4d05a3c3525
Preparing release 4.0.0-rc.15
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "{\n\"name\": \"bolt\",\n- \"version\": \"4.0.0-rc.12\",\n+ \"version\": \"4.0.0-rc.15\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n\"dependencies\": {\n\"abbrev\": {\n\"version\": \"1.1.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==\",\n\"optional\": true\n},\n\"ansi-regex\": {\n\"version\": \"2.1.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-w7M6te42DYbg5ijwRorn7yfWVN8=\",\n\"optional\": true\n},\n\"aproba\": {\n\"version\": \"1.2.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==\",\n\"optional\": true\n},\n\"are-we-there-yet\": {\n\"version\": \"1.1.5\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==\",\n\"optional\": true,\n\"requires\": {\n\"delegates\": \"^1.0.0\",\n},\n\"balanced-match\": {\n\"version\": \"1.0.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-ibTRmasr7kneFk6gK4nORi1xt2c=\",\n\"optional\": true\n},\n\"brace-expansion\": {\n\"version\": \"1.1.11\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==\",\n\"optional\": true,\n\"requires\": {\n\"balanced-match\": \"^1.0.0\",\n},\n\"chownr\": {\n\"version\": \"1.1.3\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==\",\n\"optional\": true\n},\n\"code-point-at\": {\n\"version\": \"1.1.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=\",\n\"optional\": true\n},\n\"concat-map\": {\n\"version\": \"0.0.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=\",\n\"optional\": true\n},\n\"console-control-strings\": {\n\"version\": \"1.1.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=\",\n\"optional\": true\n},\n\"core-util-is\": {\n\"version\": \"1.0.2\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=\",\n\"optional\": true\n},\n\"debug\": {\n\"version\": \"3.2.6\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==\",\n\"optional\": true,\n\"requires\": {\n\"ms\": \"^2.1.1\"\n},\n\"deep-extend\": {\n\"version\": \"0.6.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==\",\n\"optional\": true\n},\n\"delegates\": {\n\"version\": \"1.0.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=\",\n\"optional\": true\n},\n\"detect-libc\": {\n\"version\": \"1.0.3\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=\",\n\"optional\": true\n},\n\"fs-minipass\": {\n\"version\": \"1.2.7\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==\",\n\"optional\": true,\n\"requires\": {\n\"minipass\": \"^2.6.0\"\n},\n\"fs.realpath\": {\n\"version\": \"1.0.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-FQStJSMVjKpA20onh8sBQRmU6k8=\",\n\"optional\": true\n},\n\"gauge\": {\n\"version\": \"2.7.4\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=\",\n\"optional\": true,\n\"requires\": {\n\"aproba\": \"^1.0.3\",\n},\n\"glob\": {\n\"version\": \"7.1.6\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==\",\n\"optional\": true,\n\"requires\": {\n\"fs.realpath\": \"^1.0.0\",\n},\n\"has-unicode\": {\n\"version\": \"2.0.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=\",\n\"optional\": true\n},\n\"iconv-lite\": {\n\"version\": \"0.4.24\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==\",\n\"optional\": true,\n\"requires\": {\n\"safer-buffer\": \">= 2.1.2 < 3\"\n},\n\"ignore-walk\": {\n\"version\": \"3.0.3\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==\",\n\"optional\": true,\n\"requires\": {\n\"minimatch\": \"^3.0.4\"\n},\n\"inflight\": {\n\"version\": \"1.0.6\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=\",\n\"optional\": true,\n\"requires\": {\n\"once\": \"^1.3.0\",\n},\n\"inherits\": {\n\"version\": \"2.0.4\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==\",\n\"optional\": true\n},\n\"ini\": {\n\"version\": \"1.3.5\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==\",\n\"optional\": true\n},\n\"is-fullwidth-code-point\": {\n\"version\": \"1.0.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-754xOG8DGn8NZDr4L95QxFfvAMs=\",\n\"optional\": true,\n\"requires\": {\n\"number-is-nan\": \"^1.0.0\"\n},\n\"isarray\": {\n\"version\": \"1.0.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=\",\n\"optional\": true\n},\n\"minimatch\": {\n\"version\": \"3.0.4\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==\",\n\"optional\": true,\n\"requires\": {\n\"brace-expansion\": \"^1.1.7\"\n}\n},\n- \"minimist\": {\n- \"version\": \"0.0.8\",\n- \"bundled\": true,\n- \"optional\": true\n- },\n\"minipass\": {\n\"version\": \"2.9.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==\",\n\"optional\": true,\n\"requires\": {\n\"safe-buffer\": \"^5.1.2\",\n},\n\"minizlib\": {\n\"version\": \"1.3.3\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==\",\n\"optional\": true,\n\"requires\": {\n\"minipass\": \"^2.9.0\"\n}\n},\n\"mkdirp\": {\n- \"version\": \"0.5.1\",\n- \"bundled\": true,\n+ \"version\": \"0.5.5\",\n+ \"resolved\": \"https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz\",\n+ \"integrity\": \"sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==\",\n\"optional\": true,\n\"requires\": {\n- \"minimist\": \"0.0.8\"\n+ \"minimist\": \"^1.2.5\"\n}\n},\n\"ms\": {\n\"version\": \"2.1.2\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==\",\n\"optional\": true\n},\n\"needle\": {\n\"version\": \"2.4.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg==\",\n\"optional\": true,\n\"requires\": {\n\"debug\": \"^3.2.6\",\n},\n\"node-pre-gyp\": {\n\"version\": \"0.14.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==\",\n\"optional\": true,\n\"requires\": {\n\"detect-libc\": \"^1.0.2\",\n},\n\"nopt\": {\n\"version\": \"4.0.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=\",\n\"optional\": true,\n\"requires\": {\n\"abbrev\": \"1\",\n},\n\"npm-bundled\": {\n\"version\": \"1.1.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==\",\n\"optional\": true,\n\"requires\": {\n\"npm-normalize-package-bin\": \"^1.0.1\"\n},\n\"npm-normalize-package-bin\": {\n\"version\": \"1.0.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==\",\n\"optional\": true\n},\n\"npm-packlist\": {\n\"version\": \"1.4.7\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-vAj7dIkp5NhieaGZxBJB8fF4R0078rqsmhJcAfXZ6O7JJhjhPK96n5Ry1oZcfLXgfun0GWTZPOxaEyqv8GBykQ==\",\n\"optional\": true,\n\"requires\": {\n\"ignore-walk\": \"^3.0.1\",\n},\n\"npmlog\": {\n\"version\": \"4.1.2\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==\",\n\"optional\": true,\n\"requires\": {\n\"are-we-there-yet\": \"~1.1.2\",\n},\n\"number-is-nan\": {\n\"version\": \"1.0.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=\",\n\"optional\": true\n},\n\"object-assign\": {\n\"version\": \"4.1.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=\",\n\"optional\": true\n},\n\"once\": {\n\"version\": \"1.4.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-WDsap3WWHUsROsF9nFC6753Xa9E=\",\n\"optional\": true,\n\"requires\": {\n\"wrappy\": \"1\"\n},\n\"os-homedir\": {\n\"version\": \"1.0.2\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-/7xJiDNuDoM94MFox+8VISGqf7M=\",\n\"optional\": true\n},\n\"os-tmpdir\": {\n\"version\": \"1.0.2\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=\",\n\"optional\": true\n},\n\"osenv\": {\n\"version\": \"0.1.5\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==\",\n\"optional\": true,\n\"requires\": {\n\"os-homedir\": \"^1.0.0\",\n},\n\"path-is-absolute\": {\n\"version\": \"1.0.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-F0uSaHNVNP+8es5r9TpanhtcX18=\",\n\"optional\": true\n},\n\"process-nextick-args\": {\n\"version\": \"2.0.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==\",\n\"optional\": true\n},\n\"rc\": {\n\"version\": \"1.2.8\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==\",\n\"optional\": true,\n\"requires\": {\n\"deep-extend\": \"^0.6.0\",\n},\n\"dependencies\": {\n\"minimist\": {\n- \"version\": \"1.2.0\",\n- \"bundled\": true,\n+ \"version\": \"1.2.5\",\n+ \"resolved\": \"https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz\",\n+ \"integrity\": \"sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==\",\n\"optional\": true\n}\n}\n},\n\"readable-stream\": {\n\"version\": \"2.3.6\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==\",\n\"optional\": true,\n\"requires\": {\n\"core-util-is\": \"~1.0.0\",\n},\n\"rimraf\": {\n\"version\": \"2.7.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==\",\n\"optional\": true,\n\"requires\": {\n\"glob\": \"^7.1.3\"\n},\n\"safe-buffer\": {\n\"version\": \"5.1.2\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==\",\n\"optional\": true\n},\n\"safer-buffer\": {\n\"version\": \"2.1.2\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==\",\n\"optional\": true\n},\n\"sax\": {\n\"version\": \"1.2.4\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==\",\n\"optional\": true\n},\n\"semver\": {\n\"version\": \"5.7.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==\",\n\"optional\": true\n},\n\"set-blocking\": {\n\"version\": \"2.0.0\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-BF+XgtARrppoA93TgrJDkrPYkPc=\",\n\"optional\": true\n},\n\"signal-exit\": {\n\"version\": \"3.0.2\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=\",\n\"optional\": true\n},\n\"string-width\": {\n\"version\": \"1.0.2\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=\",\n\"optional\": true,\n\"requires\": {\n\"code-point-at\": \"^1.0.0\",\n},\n\"string_decoder\": {\n\"version\": \"1.1.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==\",\n\"optional\": true,\n\"requires\": {\n\"safe-buffer\": \"~5.1.0\"\n},\n\"strip-ansi\": {\n\"version\": \"3.0.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=\",\n\"optional\": true,\n\"requires\": {\n\"ansi-regex\": \"^2.0.0\"\n},\n\"strip-json-comments\": {\n\"version\": \"2.0.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-PFMZQukIwml8DsNEhYwobHygpgo=\",\n\"optional\": true\n},\n\"tar\": {\n\"version\": \"4.4.13\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==\",\n\"optional\": true,\n\"requires\": {\n\"chownr\": \"^1.1.1\",\n},\n\"util-deprecate\": {\n\"version\": \"1.0.2\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=\",\n\"optional\": true\n},\n\"wide-align\": {\n\"version\": \"1.1.3\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==\",\n\"optional\": true,\n\"requires\": {\n\"string-width\": \"^1.0.2 || 2\"\n},\n\"wrappy\": {\n\"version\": \"1.0.2\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=\",\n\"optional\": true\n},\n\"yallist\": {\n\"version\": \"3.1.1\",\n- \"bundled\": true,\n+ \"resolved\": false,\n+ \"integrity\": \"sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==\",\n\"optional\": true\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "{\n\"name\": \"bolt\",\n- \"version\": \"4.0.0-rc.12\",\n+ \"version\": \"4.0.0-rc.15\",\n\"homepage\": \"https://boltcms.io\",\n\"author\": \"Bob den Otter <bob@twokings.nl> (https://boltcms.io)\",\n\"license\": \"MIT\",\n" } ]
PHP
MIT License
bolt/core
Preparing release 4.0.0-rc.15
95,144
08.04.2020 21:33:35
-7,200
fb3661916a296096d2b02e1bdb7f28441f4d8a21
Multi-selects (like for Content) now have wide options
[ { "change_type": "MODIFY", "old_path": "assets/js/app/editor/Components/Select.vue", "new_path": "assets/js/app/editor/Components/Select.vue", "diff": "<template>\n- <div :id=\"`multiselect-${id}`\">\n+ <div :id=\"`multiselect-${id}`\" :class=\"classname\">\n<multiselect\nv-model=\"selected\"\n:allow-empty=\"allowempty\"\n@@ -52,6 +52,7 @@ export default {\nallowempty: Boolean,\ntaggable: Boolean,\nreadonly: Boolean,\n+ classname: String,\nerrormessage: String | Boolean, //string if errormessage is set, and false otherwise\n},\ndata: () => {\n" }, { "change_type": "MODIFY", "old_path": "assets/scss/vendor/multiselect.scss", "new_path": "assets/scss/vendor/multiselect.scss", "diff": "@@ -23,14 +23,14 @@ $vue-multiselect-option-selected-highlight-bg : var(--primary) !default;\n$vue-multiselect-tag-color : $dark !default;\n$vue-multiselect-tag-bg : $light !default;\n-$vue-multiselect-tag-font-size : $badge-font-size !default;\n+$vue-multiselect-tag-font-size : 0.85rem !default;\n$vue-multiselect-tag-font-weight : normal !default;\n-$vue-multiselect-tag-icon-size : 1.7rem !default;\n+$vue-multiselect-tag-icon-size : 1.5rem !default;\n$vue-multiselect-tag-icon-color : $vue-multiselect-tag-color !default;\n$vue-multiselect-tag-icon-color-hover : white !default;\n$vue-multiselect-tag-icon-bg-hover : $danger !default;\n-$vue-multiselect-tag-padding-x : 0.4rem !default;\n-$vue-multiselect-tag-padding-y : 0.25rem !default;\n+$vue-multiselect-tag-padding-x : 0.2rem !default;\n+$vue-multiselect-tag-padding-y : 0.22rem !default;\n$vue-multiselect-tag-border-radius : $badge-border-radius !default;\n$vue-multiselect-arrow-color : $dark !default;\n@@ -42,6 +42,11 @@ $vue-multiselect-spinner-thickness : 2px !default;\n$vue-multiselect-spinner-margin : -$vue-multiselect-spinner-size/2 !default;\n$vue-multiselect-spinner-color : $dark !default;\n+//** Overrides for Bolt **//\n+.wide-options .multiselect__tag {\n+ width: 100%;\n+}\n+\n// --------------------------------\n// Select field\n//--\n@@ -187,7 +192,7 @@ fieldset[disabled] .multiselect {\ntext-align: center;\nline-height: $vue-multiselect-tag-icon-size;\ntransition: all 0.2s ease;\n- font-size: $vue-multiselect-tag-font-size;\n+ font-size: 0.6rem;\nfont-weight: $vue-multiselect-tag-font-weight;\n}\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/select.html.twig", "new_path": "templates/_partials/fields/select.html.twig", "diff": "{% block field %}\n<editor-select\n+ :classname=\"{{ \"wide-options\"|json_encode }}\"\n:value=\"{{ value|json_encode }}\"\n:name='{{ name|json_encode }}'\n:id='{{ id|json_encode }}'\n" } ]
PHP
MIT License
bolt/core
Multi-selects (like for Content) now have wide options
95,144
09.04.2020 15:48:39
-7,200
4541e25b71dbd4265db072b80a1ddaee8e75601e
More resilient check for empty locales
[ { "change_type": "MODIFY", "old_path": "src/Entity/Field.php", "new_path": "src/Entity/Field.php", "diff": "@@ -309,7 +309,7 @@ class Field implements FieldInterface, TranslatableInterface\n$locales = $this->getContent()->getDefinition()->get('locales');\n- if ($locales->isEmpty()) {\n+ if (empty($locales) || $locales->isEmpty()) {\nreturn $this;\n}\n" } ]
PHP
MIT License
bolt/core
More resilient check for empty locales
95,144
13.04.2020 11:46:35
-7,200
8a51a0e3d7a9abb96acee846decb433fa642aca8
More emphasis on purpose of repo.
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -17,9 +17,11 @@ Follow the progress on Bolt 4, at the following locations\n- Bolt 4 roadmap: https://roadmap.boltcms.io\n- Slack: https://slack.bolt.cm (open for all, requires Slack account)\n-**If you want to check out Bolt, the `composer create-project` method is\n-recommended. See here: https://github.com/bolt/project/ . This\n-repository should be used to work _on_ Bolt. Not _with_ Bolt.**\n+---\n+\n+**If you want to check out Bolt, the `composer create-project` method is recommended. See here: https://github.com/bolt/project/ . This repository should be used to work _\\_on\\__ Bolt. Not _\\_with\\__ Bolt.**\n+\n+---\nTo set up a running environment of Bolt 4 please perform the following steps 1 to 4:\n" } ]
PHP
MIT License
bolt/core
More emphasis on purpose of repo.
95,144
13.04.2020 11:48:02
-7,200
7fdff9b967801797a66c61168f170815be3311f5
Better emphasis
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -19,7 +19,7 @@ Follow the progress on Bolt 4, at the following locations\n---\n-**If you want to check out Bolt, the `composer create-project` method is recommended. See here: https://github.com/bolt/project/ . This repository should be used to work _\\_on\\__ Bolt. Not _\\_with\\__ Bolt.**\n+**If you want to check out Bolt, the `composer create-project` method is recommended. See here: https://github.com/bolt/project/ . This repository should be used to work _<ins>on</ins>_ Bolt. Not _<ins>with</ins>_ Bolt.**\n---\n" } ]
PHP
MIT License
bolt/core
Better emphasis
95,144
13.04.2020 12:44:33
-7,200
8215ece521fd9502caa9fd6a3f6c89819eb37586
Include sets in collections in "Fields" output
[ { "change_type": "MODIFY", "old_path": "templates/helpers/_fields.twig", "new_path": "templates/helpers/_fields.twig", "diff": "{% for name, definition in record.definition.fields|filter((definition, name) => definition.slug not in omittedkeys and record.hasField(name)) %}\n{% set field = record.field(name) %}\n+\n+ {{ block('output_field') }}\n+\n+ {% endfor %}\n+{% endblock sub_fields %}\n+\n+{% block output_field %}\n{% set type = field|type %}\n{# Fields that are considered 'common': 'html', 'markdown', 'textarea', 'text', 'image', 'video' #}\n{{ block('extended_fields') }}\n{% endif %}\n- {# Finally, the collections, filelists and imagelists #}\n+ {# Finally, recursively for the collections, sets, filelists and imagelists #}\n{% if type in ['collection', 'filelist', 'imagelist', 'set'] and (type not in exclude|default([])) %}\n-\n{% for field in field.value %}\n- {% set type = field.type %}\n- {{ block('common_fields') }}\n- {{ block('extended_fields') }}\n+ {{ block('output_field') }}\n{% endfor %}\n-\n{% endif %}\n-\n- {% endfor %}\n-\n-{% endblock sub_fields %}\n+{% endblock %}\n\\ No newline at end of file\n" } ]
PHP
MIT License
bolt/core
Include sets in collections in "Fields" output
95,144
15.04.2020 15:23:31
-7,200
f8d837dcad832f5161d3c56ac473b94636379350
Update templates/content/_fields.html.twig
[ { "change_type": "MODIFY", "old_path": "templates/content/_fields.html.twig", "new_path": "templates/content/_fields.html.twig", "diff": "{# If the field is translatable, we want the translated value in the current locale #}\n{% set field = field|translated(currentlocale) %}\n{% else %}\n- {# Othewise, we want the value in the default locale, exlicitly in case it is something else #}\n+ {# Otherwise, we want the value in the default locale, explicitly in case it is something else #}\n{% set field = field|translated(field.defaultLocale) %}\n{% endif %}\n{% else %}\n" } ]
PHP
MIT License
bolt/core
Update templates/content/_fields.html.twig
95,144
18.04.2020 17:58:01
-7,200
f29cf7ec600f4b3dea301ab6bf7175bb4784e3b3
Have "preview" correctly detect if we're requesting the homepage
[ { "change_type": "MODIFY", "old_path": "src/TemplateChooser.php", "new_path": "src/TemplateChooser.php", "diff": "@@ -7,6 +7,7 @@ namespace Bolt;\nuse Bolt\\Configuration\\Config;\nuse Bolt\\Configuration\\Content\\ContentType;\nuse Bolt\\Entity\\Content;\n+use Bolt\\Twig\\ContentExtension;\nuse Tightenco\\Collect\\Support\\Collection;\nclass TemplateChooser\n@@ -14,9 +15,13 @@ class TemplateChooser\n/** @var Config */\nprivate $config;\n- public function __construct(Config $config)\n+ /** @var ContentExtension */\n+ private $contentExtension;\n+\n+ public function __construct(Config $config, ContentExtension $contentExtension)\n{\n$this->config = $config;\n+ $this->contentExtension = $contentExtension;\n}\npublic function forHomepage(?Content $content = null): array\n@@ -50,6 +55,11 @@ class TemplateChooser\n$templates = new Collection();\n$definition = $record->getDefinition();\n+ // First candidate: Content record is the homepage\n+ if ($this->contentExtension->isHomepage($record)) {\n+ $templates = collect($this->forHomepage());\n+ }\n+\n// First candidate: Content record has a templateselect field, and it's set.\nforeach ($definition->get('fields') as $name => $field) {\nif ($field['type'] === 'templateselect' && $record->hasField($name)) {\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -350,6 +350,10 @@ class ContentExtension extends AbstractExtension\nreturn null;\n}\n+ if ($this->isHomepage($content)) {\n+ return $this->generateLink('homepage', [], $canonical);\n+ }\n+\n$params = [\n'slugOrId' => $content->getSlug() ?: $content->getId(),\n'contentTypeSlug' => $content->getContentTypeSingularSlug(),\n@@ -358,6 +362,18 @@ class ContentExtension extends AbstractExtension\nreturn $this->generateLink('record', $params, $canonical);\n}\n+ public function isHomepage(Content $content): bool\n+ {\n+ $homepageSetting = explode('/', $this->config->get('general/homepage'));\n+\n+ if (empty($homepageSetting[1])) {\n+ return false;\n+ }\n+\n+ return ($homepageSetting[0] === $content->getContentTypeSingularSlug() || $homepageSetting[0] === $content->getContentTypeSlug()) &&\n+ ($homepageSetting[1] === $content->getSlug() || $homepageSetting[1] === (string) $content->getId());\n+ }\n+\npublic function getEditLink(Content $content): ?string\n{\nif ($content->getId() === null || ! $this->security->getUser()) {\n" } ]
PHP
MIT License
bolt/core
Have "preview" correctly detect if we're requesting the homepage
95,144
19.04.2020 11:42:16
-7,200
bf898f7d19db14cf869c28126c5cfcc6e932167b
Add Labels for statuses
[ { "change_type": "MODIFY", "old_path": "assets/js/app/editor/Components/Select.vue", "new_path": "assets/js/app/editor/Components/Select.vue", "diff": ">\n<template v-if=\"name === 'status'\" slot=\"singleLabel\" slot-scope=\"props\">\n<span class=\"status mr-2\" :class=\"`is-${props.option.key}`\"></span>\n- {{ props.option.key }}\n+ {{ props.option.value }}\n</template>\n<template v-if=\"name === 'status'\" slot=\"option\" slot-scope=\"props\">\n<span class=\"status mr-2\" :class=\"`is-${props.option.key}`\"></span>\n- {{ props.option.key }}\n+ {{ props.option.value }}\n</template>\n</multiselect>\n<input\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Content.php", "new_path": "src/Entity/Content.php", "diff": "@@ -559,21 +559,6 @@ class Content\nreturn Statuses::all();\n}\n- public function getStatusOptions(): array\n- {\n- $options = [];\n-\n- foreach (Statuses::all() as $option) {\n- $options[] = [\n- 'key' => $option,\n- 'value' => ucwords($option),\n- 'selected' => $option === $this->getStatus(),\n- ];\n- }\n-\n- return $options;\n- }\n-\npublic function hasTaxonomyDefined(string $taxonomyName): bool\n{\nreturn $this->contentTypeDefinition->get('taxonomy')->contains($taxonomyName);\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -11,6 +11,7 @@ use Bolt\\Entity\\Field\\ImageField;\nuse Bolt\\Entity\\Field\\ImagelistField;\nuse Bolt\\Entity\\Field\\SelectField;\nuse Bolt\\Entity\\Field\\TemplateselectField;\n+use Bolt\\Enum\\Statuses;\nuse Bolt\\Log\\LoggerTrait;\nuse Bolt\\Repository\\ContentRepository;\nuse Bolt\\Repository\\TaxonomyRepository;\n@@ -26,6 +27,7 @@ use Symfony\\Component\\Routing\\Exception\\InvalidParameterException;\nuse Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface;\nuse Symfony\\Component\\Security\\Core\\Security;\nuse Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface;\n+use Symfony\\Contracts\\Translation\\TranslatorInterface;\nuse Tightenco\\Collect\\Support\\Collection;\nuse Tightenco\\Collect\\Support\\Collection as LaravelCollection;\nuse Twig\\Environment;\n@@ -62,6 +64,9 @@ class ContentExtension extends AbstractExtension\n/** @var TaxonomyRepository */\nprivate $taxonomyRepository;\n+ /** @var TranslatorInterface */\n+ private $translator;\n+\npublic function __construct(\nUrlGeneratorInterface $urlGenerator,\nContentRepository $contentRepository,\n@@ -70,7 +75,8 @@ class ContentExtension extends AbstractExtension\nRequestStack $requestStack,\nConfig $config,\nQuery $query,\n- TaxonomyRepository $taxonomyRepository\n+ TaxonomyRepository $taxonomyRepository,\n+ TranslatorInterface $translator\n) {\n$this->urlGenerator = $urlGenerator;\n$this->contentRepository = $contentRepository;\n@@ -80,6 +86,7 @@ class ContentExtension extends AbstractExtension\n$this->config = $config;\n$this->query = $query;\n$this->taxonomyRepository = $taxonomyRepository;\n+ $this->translator = $translator;\n}\n/**\n@@ -105,6 +112,7 @@ class ContentExtension extends AbstractExtension\nnew TwigFilter('taxonomies', [$this, 'getTaxonomies']),\nnew TwigFilter('has_path', [$this, 'hasPath']),\nnew TwigFilter('allow_twig', [$this, 'allowTwig'], $env),\n+ new TwigFilter('status_options', [$this, 'statusOptions']),\n];\n}\n@@ -676,4 +684,19 @@ class ContentExtension extends AbstractExtension\nreturn false;\n}\n+\n+ public function statusOptions(Content $record)\n+ {\n+ $options = [];\n+\n+ foreach (Statuses::all() as $option) {\n+ $options[] = [\n+ 'key' => $option,\n+ 'value' => $this->translator->trans('status.' . $option),\n+ 'selected' => $option === $record->getStatus(),\n+ ];\n+ }\n+\n+ return $options;\n+ }\n}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_buttons.html.twig", "new_path": "templates/content/_buttons.html.twig", "diff": "}) }}\n</div>\n+ {% if status|default() %}\n+ <p>\n+ <strong>{{ __('label.current_status') }}:</strong>\n+ <span class=\"status mx-1 is-{{ record.status}}\"></span>{{ __('status.' ~ record.status) }}\n+ </p>\n+ {% endif %}\n+\n{% if record.status == \"published\" %}\n<div class=\"form-fieldsgroup__summary-fields\">\n- <a href=\"{{ record|link(true) }}\" target=\"_blank\">{{ macro.icon('fa-sign-out-alt') }} {{ 'action.view_saved'|trans }}</a>\n+ <a href=\"{{ record|link(true) }}\" target=\"_blank\">{{ macro.icon('fa-sign-out-alt') }} {{ __('action.view_saved') }}</a>\n</div>\n{% endif %}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_fields_aside.html.twig", "new_path": "templates/content/_fields_aside.html.twig", "diff": "'label' : 'field.status'|trans,\n'name' : 'status',\n'value' : [record.status],\n- 'options' : record.statusoptions,\n+ 'options' : record|status_options,\n'form' : 'editcontent',\n'required' : true\n} %}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/edit.html.twig", "new_path": "templates/content/edit.html.twig", "diff": "{{ 'title.save_changes'|trans }}\n</div>\n<div class=\"card-body\">\n- {% include '@bolt/content/_buttons.html.twig' %}\n+ {% include '@bolt/content/_buttons.html.twig' with {'status': true} %}\n</div>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "translations/messages.en.xlf", "new_path": "translations/messages.en.xlf", "diff": "<target>Content deleted successfully</target>\n</segment>\n</unit>\n+ <unit id=\".I3mIHo\" name=\"label.current_status\">\n+ <segment>\n+ <source>label.current_status</source>\n+ <target>Current status</target>\n+ </segment>\n+ </unit>\n+ <unit id=\"utGAKaQ\" name=\"status.published\">\n+ <segment>\n+ <source>status.published</source>\n+ <target>Published</target>\n+ </segment>\n+ </unit>\n+ <unit id=\"utGAKaW\" name=\"status.draft\">\n+ <segment>\n+ <source>status.draft</source>\n+ <target>Draft</target>\n+ </segment>\n+ </unit>\n+ <unit id=\"utGAKaE\" name=\"status.timed\">\n+ <segment>\n+ <source>status.timed</source>\n+ <target>Timed</target>\n+ </segment>\n+ </unit>\n+ <unit id=\"utGAKaR\" name=\"status.held\">\n+ <segment>\n+ <source>status.held</source>\n+ <target>Held</target>\n+ </segment>\n+ </unit>\n</file>\n</xliff>\n" }, { "change_type": "MODIFY", "old_path": "translations/messages.nl.xlf", "new_path": "translations/messages.nl.xlf", "diff": "<target>Volgende</target>\n</segment>\n</unit>\n+ <unit id=\".I3mIHo\" name=\"label.current_status\">\n+ <segment>\n+ <source>label.current_status</source>\n+ <target>Current status</target>\n+ </segment>\n+ </unit>\n+ <unit id=\"utGAKaQ\" name=\"status.published\">\n+ <segment>\n+ <source>status.published</source>\n+ <target>Gepubliceerd</target>\n+ </segment>\n+ </unit>\n+ <unit id=\"utGAKaW\" name=\"status.draft\">\n+ <segment>\n+ <source>status.draft</source>\n+ <target>In klad</target>\n+ </segment>\n+ </unit>\n+ <unit id=\"utGAKaE\" name=\"status.timed\">\n+ <segment>\n+ <source>status.timed</source>\n+ <target>Ingepland</target>\n+ </segment>\n+ </unit>\n+ <unit id=\"utGAKaR\" name=\"status.held\">\n+ <segment>\n+ <source>status.held</source>\n+ <target>Achtergehouden</target>\n+ </segment>\n+ </unit>\n</file>\n</xliff>\n" } ]
PHP
MIT License
bolt/core
Add Labels for statuses
95,144
19.04.2020 13:25:52
-7,200
9cfd5a9946a9631e2282e428e4b3d102834abccb
Add shiny badges for special pages
[ { "change_type": "MODIFY", "old_path": "assets/js/app/listing/Components/Table/Row/index.vue", "new_path": "assets/js/app/listing/Components/Table/Row/index.vue", "diff": ">\n{{ record.extras.title | trim(62) | raw }}\n</a>\n+ <span v-if=\"record.extras.feature\" class=\"badge\" :class=\"`badge-${record.extras.feature}`\">{{ record.extras.feature }}</span>\n<span class=\"listing__row--item-title-excerpt\">{{\nrecord.extras.excerpt | raw\n}}</span>\n" }, { "change_type": "MODIFY", "old_path": "assets/scss/modules/base/_status.scss", "new_path": "assets/scss/modules/base/_status.scss", "diff": "background: var(--status-timed);\n}\n}\n+\n+.badge-homepage, .badge-404, .badge-maintenance {\n+ font-weight: normal;\n+ vertical-align: middle;\n+ margin-top: -0.4em;\n+ text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);\n+}\n+\n+.badge-homepage {\n+ background: $secondary;\n+}\n+\n+.badge-404 {\n+ background: $warning;\n+}\n+\n+.badge-maintenance {\n+ background: $tertiary;\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/ContentExtrasTrait.php", "new_path": "src/Entity/ContentExtrasTrait.php", "diff": "@@ -42,6 +42,7 @@ trait ContentExtrasTrait\n'icon' => $this->getIcon(),\n'name' => $this->getDefinition()->get('name'),\n'singular_name' => $this->getDefinition()->get('singular_name'),\n+ 'feature' => $this->contentExtension->getSpecialFeature($content),\n]);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -113,6 +113,7 @@ class ContentExtension extends AbstractExtension\nnew TwigFilter('has_path', [$this, 'hasPath']),\nnew TwigFilter('allow_twig', [$this, 'allowTwig'], $env),\nnew TwigFilter('status_options', [$this, 'statusOptions']),\n+ new TwigFilter('feature', [$this, 'getSpecialFeature']),\n];\n}\n@@ -370,17 +371,6 @@ class ContentExtension extends AbstractExtension\nreturn $this->generateLink('record', $params, $canonical);\n}\n- public function isHomepage(Content $content): bool\n- {\n- $homepageSetting = explode('/', $this->config->get('general/homepage'));\n-\n- if (empty($homepageSetting[1])) {\n- return false;\n- }\n-\n- return ($homepageSetting[0] === $content->getContentTypeSingularSlug() || $homepageSetting[0] === $content->getContentTypeSlug()) &&\n- ($homepageSetting[1] === $content->getSlug() || $homepageSetting[1] === (string) $content->getId());\n- }\npublic function getEditLink(Content $content): ?string\n{\n@@ -699,4 +689,60 @@ class ContentExtension extends AbstractExtension\nreturn $options;\n}\n+\n+ public function getSpecialFeature(Content $record): string\n+ {\n+ if ($this->isHomepage($record)) {\n+ return 'homepage';\n+ }\n+\n+ if ($this->is404($record)) {\n+ return '404';\n+ }\n+\n+ if ($this->isMaintenance($record)) {\n+ return 'maintenance';\n+ }\n+\n+ return '';\n+ }\n+\n+ public function isHomepage(Content $content): bool\n+ {\n+ return $this->isSpecialpage($content, 'homepage');\n+ }\n+\n+ public function is404(Content $content): bool\n+ {\n+ return $this->isSpecialpage($content, 'notfound');\n+ }\n+\n+ public function isMaintenance(Content $content): bool\n+ {\n+ return $this->isSpecialpage($content, 'maintenance');\n+ }\n+\n+ private function isSpecialpage(Content $content, string $type): bool\n+ {\n+ $configSetting = $this->config->get('general/' . $type);\n+\n+ if (! is_iterable($configSetting)) {\n+ $configSetting = (array) $configSetting;\n+ }\n+\n+ foreach ($configSetting as $item) {\n+ $item = explode('/', $item);\n+\n+ if (empty($item[1])) {\n+ continue;\n+ }\n+\n+ if (($item[0] === $content->getContentTypeSingularSlug() || $item[0] === $content->getContentTypeSlug()) &&\n+ ($item[1] === $content->getSlug() || $item[1] === (string) $content->getId())) {\n+ return true;\n+ }\n+ }\n+\n+ return false;\n+ }\n}\n" } ]
PHP
MIT License
bolt/core
Add shiny badges for special pages
95,144
19.04.2020 16:19:52
-7,200
a71e63aa6b4c3feb610d98ecae7024d082e2d8de
Preparing release 4.0.0-rc.17
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "{\n\"name\": \"bolt\",\n- \"version\": \"4.0.0-rc.16\",\n+ \"version\": \"4.0.0-rc.17\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n}\n},\n\"stylelint-scss\": {\n- \"version\": \"3.16.1\",\n- \"resolved\": \"https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-3.16.1.tgz\",\n- \"integrity\": \"sha512-ATApYyUzIuwuppReVdAgjpJ77OXRQacV6Ff3vvYaT9z993ZOsSTEN+urdXsk9V28yWCLiAzcNjNZe01aw0VGBg==\",\n+ \"version\": \"3.17.0\",\n+ \"resolved\": \"https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-3.17.0.tgz\",\n+ \"integrity\": \"sha512-zY6fLHailK3++UEtGOwa5BKeWemLOXUATRlV7H056Z+xCT224/TaLXR5x2zjPXFMEf89uqwv15yM9zhbwm/zDw==\",\n\"requires\": {\n\"lodash\": \"^4.17.15\",\n\"postcss-media-query-parser\": \"^0.2.3\",\n}\n},\n\"vuex\": {\n- \"version\": \"3.1.3\",\n- \"resolved\": \"https://registry.npmjs.org/vuex/-/vuex-3.1.3.tgz\",\n- \"integrity\": \"sha512-k8vZqNMSNMgKelVZAPYw5MNb2xWSmVgCKtYKAptvm9YtZiOXnRXFWu//Y9zQNORTrm3dNj1n/WaZZI26tIX6Mw==\"\n+ \"version\": \"3.2.0\",\n+ \"resolved\": \"https://registry.npmjs.org/vuex/-/vuex-3.2.0.tgz\",\n+ \"integrity\": \"sha512-qBZGJJ1gUNWZbfZlH7ylIPwENg3R0Ckpq+qPexF065kOMOt1Ixt8WDJmtssVv7OhepWD0+Qie7pOS8f0oQy1JA==\"\n},\n\"w3c-hr-time\": {\n\"version\": \"1.0.2\",\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "{\n\"name\": \"bolt\",\n- \"version\": \"4.0.0-rc.16\",\n+ \"version\": \"4.0.0-rc.17\",\n\"homepage\": \"https://boltcms.io\",\n\"author\": \"Bob den Otter <bob@twokings.nl> (https://boltcms.io)\",\n\"license\": \"MIT\",\n\"selectize\": \"^0.12.6\",\n\"simplemde\": \"^1.11.2\",\n\"stylelint-config-recommended-scss\": \"^4.2.0\",\n- \"stylelint-scss\": \"^3.16.1\",\n+ \"stylelint-scss\": \"^3.17.0\",\n\"terser\": \"^4.6.11\",\n\"tinycolor2\": \"^1.4.1\",\n\"vue\": \"^2.6.11\",\n\"vue-simplemde\": \"^1.0.4\",\n\"vue-trumbowyg\": \"^3.6.0\",\n\"vuedraggable\": \"^2.23.2\",\n- \"vuex\": \"^3.1.3\",\n+ \"vuex\": \"^3.2.0\",\n\"zxcvbn\": \"^4.4.2\"\n},\n\"devDependencies\": {\n" } ]
PHP
MIT License
bolt/core
Preparing release 4.0.0-rc.17
95,138
18.04.2020 15:35:08
18,000
bc58b1e8c8300c37aa55fa4051d39f127e282a53
Filter both Content and Field APIs to exclude unpublished and viewless content.
[ { "change_type": "MODIFY", "old_path": "src/Api/Extensions/ContentExtension.php", "new_path": "src/Api/Extensions/ContentExtension.php", "diff": "@@ -9,7 +9,9 @@ use ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\QueryItemExtensionInterface;\nuse ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Util\\QueryNameGeneratorInterface;\nuse Bolt\\Configuration\\Config;\nuse Bolt\\Entity\\Content;\n+use Bolt\\Entity\\Field;\nuse Bolt\\Enum\\Statuses;\n+use Doctrine\\ORM\\Query\\Expr\\Join;\nuse Doctrine\\ORM\\QueryBuilder;\nfinal class ContentExtension implements QueryCollectionExtensionInterface, QueryItemExtensionInterface\n@@ -17,48 +19,55 @@ final class ContentExtension implements QueryCollectionExtensionInterface, Query\n/** @var Config */\nprivate $config;\n+ private $viewlessContentTypes;\n+\npublic function __construct(Config $config)\n{\n$this->config = $config;\n+\n+ $this->viewlessContentTypes = $this->config->get('contenttypes')->filter(function ($ct) {\n+ return $ct->get('viewless', false);\n+ })->map(function ($ct) {\n+ return $ct->get('slug');\n+ })->toArray();\n}\npublic function applyToCollection(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?string $operationName = null): void\n{\n- if ($resourceClass !== Content::class) {\n- return;\n+ if ($resourceClass === Content::class) {\n+ $this->filterUnpublishedViewlessContent($queryBuilder);\n}\n- $this->requirePublishedContent($queryBuilder);\n+ if ($resourceClass === Field::class) {\n+ $this->filterUnpublishedViewlessFields($queryBuilder);\n+ }\n}\npublic function applyToItem(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, array $identifiers, ?string $operationName = null, array $context = []): void\n{\n- if ($resourceClass !== Content::class) {\n- return;\n+ if ($resourceClass === Content::class) {\n+ $this->filterUnpublishedViewlessContent($queryBuilder);\n}\n- $this->requirePublishedContent($queryBuilder);\n- $this->excludeViewlessContent($queryBuilder);\n+ if ($resourceClass === Field::class) {\n+ $this->filterUnpublishedViewlessFields($queryBuilder);\n+ }\n}\n- private function requirePublishedContent(QueryBuilder $queryBuilder): void\n+ private function filterUnpublishedViewlessContent(QueryBuilder $queryBuilder): void\n{\n$rootAlias = $queryBuilder->getRootAliases()[0];\n$queryBuilder->andWhere(sprintf('%s.status = :status', $rootAlias));\n+ $queryBuilder->andWhere(sprintf('%s.contentType NOT IN (:cts)', $rootAlias));\n$queryBuilder->setParameter('status', Statuses::PUBLISHED);\n+ $queryBuilder->setParameter('cts', $this->viewlessContentTypes);\n}\n- private function excludeViewlessContent(QueryBuilder $queryBuilder): void\n+ private function filterUnpublishedViewlessFields(QueryBuilder $queryBuilder): void\n{\n$rootAlias = $queryBuilder->getRootAliases()[0];\n-\n- $viewlessContentTypes = $this->config->get('contenttypes')->filter(function ($ct) {\n- return $ct->get('viewless', false);\n- })->map(function ($ct) {\n- return $ct->get('slug');\n- })->toArray();\n-\n- $queryBuilder->andWhere(sprintf('%s.contentType NOT IN (:cts)', $rootAlias));\n- $queryBuilder->setParameter('cts', $viewlessContentTypes);\n+ $queryBuilder->join($rootAlias . '.content', 'c', Join::WITH, 'c.status = :status AND c.contentType NOT IN (:cts)');\n+ $queryBuilder->setParameter('status', Statuses::PUBLISHED);\n+ $queryBuilder->setParameter('cts', $this->viewlessContentTypes);\n}\n}\n" } ]
PHP
MIT License
bolt/core
Filter both Content and Field APIs to exclude unpublished and viewless content.
95,134
22.04.2020 14:12:38
-3,600
0398f88ca409cba8ad280f2180d56e22aef67fcc
Update Field.php fix for foreign key constraint issue affecting Collections/Sets
[ { "change_type": "MODIFY", "old_path": "src/Entity/Field.php", "new_path": "src/Entity/Field.php", "diff": "@@ -72,6 +72,7 @@ class Field implements FieldInterface, TranslatableInterface\n/**\n* @ORM\\ManyToOne(targetEntity=\"Bolt\\Entity\\Field\", cascade={\"persist\"})\n+ * @ORM\\JoinColumn(onDelete=\"CASCADE\")\n*/\nprivate $parent;\n" } ]
PHP
MIT License
bolt/core
Update Field.php fix for foreign key constraint issue affecting Collections/Sets
95,144
27.04.2020 14:47:21
-7,200
5ea6150c36e29658df65f76ecda09294d2b753f8
Make it so `homepage:` accepts a singleton, or a contentType listing
[ { "change_type": "MODIFY", "old_path": "config/bolt/config.yaml", "new_path": "config/bolt/config.yaml", "diff": "@@ -60,14 +60,15 @@ omit_backgrounds: true\n#favicon: images/favicon-bolt.ico\n# The default content to use for the homepage, and the template to render it\n-# with. This can either be a specific record (like `page/1`) or a listing of\n-# records (like `entries`). In the chosen homepage_template, you will have\n-# `record` or `records` at your disposal, depending on the homepage setting.\n+# with. This can either be a singleton like `homepage`, a specific record (like\n+# `page/1`) or a listing of records (like `entries`). In the chosen\n+# homepage_template, you will have `record` or `records` at your disposal,\n+# depending on the homepage setting.\n#\n# Note: If you've changed the filename, and your changes do not show up on\n-# the website, be sure to check for a theme.yml file in your themes\n+# the website, be sure to check for a theme.yaml file in your themes\n# folder. If a template is set there, it will override the setting here.\n-homepage: homepage/1\n+homepage: homepage\nhomepage_template: index.twig\n# The default content for the 404 page. Can be an (array of) template names or\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Frontend/HomepageController.php", "new_path": "src/Controller/Frontend/HomepageController.php", "diff": "@@ -32,11 +32,19 @@ class HomepageController extends TwigAwareController implements FrontendZoneInte\n{\n$homepage = $this->config->get('theme/homepage') ?: $this->config->get('general/homepage');\n$params = explode('/', $homepage);\n+ $contentType = $this->config->get('contenttypes/' . $params[0]);\n+\n+ // Perhaps we need a listing instead. If so, forward the Request there\n+ if (! $contentType->get('singleton') && ! isset($params[1])) {\n+ return $this->forward('Bolt\\Controller\\Frontend\\ListingController::listing', [\n+ 'contentTypeSlug' => $homepage,\n+ ]);\n+ }\n// @todo Get $homepage content, using \"setcontent\"\n$record = $contentRepository->findOneBy([\n- 'contentType' => $params[0],\n- 'id' => $params[1],\n+ 'contentType' => $contentType->get('slug'),\n+ 'id' => $params[1] ?? 1,\n]);\nif (! $record) {\n$record = $contentRepository->findOneBy(['contentType' => $params[0]]);\n" }, { "change_type": "MODIFY", "old_path": "src/TemplateChooser.php", "new_path": "src/TemplateChooser.php", "diff": "@@ -60,30 +60,30 @@ class TemplateChooser\n$templates = collect($this->forHomepage());\n}\n- // First candidate: Content record has a templateselect field, and it's set.\n+ // Second candidate: Content record has a templateselect field, and it's set.\nforeach ($definition->get('fields') as $name => $field) {\nif ($field['type'] === 'templateselect' && $record->hasField($name)) {\n$templates->push((string) $record->getField($name));\n}\n}\n- // Second candidate: defined specifically in the content type.\n+ // Third candidate: defined specifically in the content type.\nif ($definition->has('record_template')) {\n$templates->push($definition->get('record_template'));\n}\n- // Third candidate: a template with the same filename as the name of\n+ // Fourth candidate: a template with the same filename as the name of\n// the content type.\n$templates->push($definition->get('singular_slug') . '.html.twig');\n$templates->push($definition->get('singular_slug') . '.twig');\n- // Fourth candidate: Theme-specific config.yml file.\n+ // Fifth candidate: Theme-specific config.yml file.\n$templates->push($this->config->get('theme/record_template'));\n- // Fifth candidate: global config.yml\n+ // Sixth candidate: global config.yml\n$templates->push($this->config->get('general/record_template'));\n- // Sixth candidate: fallback to 'record.html.twig'\n+ // Seventh candidate: fallback to 'record.html.twig'\n$templates->push('record.html.twig');\nreturn $templates->unique()->filter()->toArray();\n@@ -93,23 +93,28 @@ class TemplateChooser\n{\n$templates = new Collection();\n- // First candidate: defined specifically in the content type.\n+ // First candidate: Content record is the homepage\n+ if ($this->contentExtension->isHomepageListing($contentType)) {\n+ $templates = collect($this->forHomepage());\n+ }\n+\n+ // Second candidate: defined specifically in the content type.\nif (! empty($contentType['listing_template'])) {\n$templates->push($contentType['listing_template']);\n}\n- // Second candidate: a template with the same filename as the name of\n+ // Third candidate: a template with the same filename as the name of\n// the content type.\n$templates->push($contentType->getSlug() . '.html.twig');\n$templates->push($contentType->getSlug() . '.twig');\n- // Third candidate: Theme-specific config.yml file.\n+ // Fourth candidate: Theme-specific config.yml file.\n$templates->push($this->config->get('theme/listing_template'));\n- // Fourth candidate: Global config.yml\n+ // Fifth candidate: Global config.yml\n$templates->push($this->config->get('general/listing_template'));\n- // Fifth candidate: fallback to 'listing.html.twig'\n+ // Sixth candidate: fallback to 'listing.html.twig'\n$templates->push('listing.html.twig');\nreturn $templates->unique()->filter()->toArray();\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -5,6 +5,7 @@ declare(strict_types=1);\nnamespace Bolt\\Twig;\nuse Bolt\\Configuration\\Config;\n+use Bolt\\Configuration\\Content\\ContentType;\nuse Bolt\\Entity\\Content;\nuse Bolt\\Entity\\Field\\Excerptable;\nuse Bolt\\Entity\\Field\\ImageField;\n@@ -749,4 +750,15 @@ class ContentExtension extends AbstractExtension\nreturn false;\n}\n+\n+ public function isHomepageListing(ContentType $contentType): bool\n+ {\n+ $homepageSetting = $this->config->get('general/homepage');\n+\n+ if ($homepageSetting === $contentType->get('slug') || $homepageSetting === $contentType->get('singular_slug')) {\n+ return true;\n+ }\n+\n+ return false;\n+ }\n}\n" } ]
PHP
MIT License
bolt/core
Make it so `homepage:` accepts a singleton, or a contentType listing
95,144
27.04.2020 14:56:57
-7,200
0ccb70780dcffd0dc737e6ea13b366c3439dc70e
Updating symfony/webpack-encore to 0.29
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "}\n},\n\"@symfony/webpack-encore\": {\n- \"version\": \"0.28.3\",\n- \"resolved\": \"https://registry.npmjs.org/@symfony/webpack-encore/-/webpack-encore-0.28.3.tgz\",\n- \"integrity\": \"sha512-ZXnwU6uobDCRMbZhT99c42/6j9yIM9aGWgT/we6fdaEGgJJmO1dXl4heq+flL61K3wztQqW6G54N8Q6aPcz1Xw==\",\n+ \"version\": \"0.29.1\",\n+ \"resolved\": \"https://registry.npmjs.org/@symfony/webpack-encore/-/webpack-encore-0.29.1.tgz\",\n+ \"integrity\": \"sha512-/ZICF0Tbt/1fvSFlSFfvqbQz6WVuzprpQMrUn7c3cTzUmjpW6lm6C5Z1D/0kvL2K1xB46KntIYCmaeWKzByDoA==\",\n\"dev\": true,\n\"requires\": {\n\"@babel/core\": \"^7.4.0\",\n\"babel-loader\": \"^8.0.0\",\n\"chalk\": \"^2.4.1\",\n\"clean-webpack-plugin\": \"^0.1.19\",\n- \"css-loader\": \"^2.1.1\",\n+ \"css-loader\": \"^3.5.2\",\n\"fast-levenshtein\": \"^2.0.6\",\n- \"file-loader\": \"^1.1.10\",\n+ \"file-loader\": \"^6.0.0\",\n\"friendly-errors-webpack-plugin\": \"^2.0.0-beta.1\",\n\"loader-utils\": \"^1.1.0\",\n\"mini-css-extract-plugin\": \">=0.4.0 <0.4.3\",\n\"pretty-error\": \"^2.1.1\",\n\"resolve-url-loader\": \"^3.0.1\",\n\"semver\": \"^5.5.0\",\n- \"style-loader\": \"^0.21.0\",\n+ \"style-loader\": \"^1.1.3\",\n\"terser-webpack-plugin\": \"^1.1.0\",\n\"tmp\": \"^0.0.33\",\n\"webpack\": \"^4.20.0\",\n\"yargs-parser\": \"^12.0.0\"\n},\n\"dependencies\": {\n+ \"ajv\": {\n+ \"version\": \"6.12.2\",\n+ \"resolved\": \"https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz\",\n+ \"integrity\": \"sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"fast-deep-equal\": \"^3.1.1\",\n+ \"fast-json-stable-stringify\": \"^2.0.0\",\n+ \"json-schema-traverse\": \"^0.4.1\",\n+ \"uri-js\": \"^4.2.2\"\n+ }\n+ },\n\"css-loader\": {\n- \"version\": \"2.1.1\",\n- \"resolved\": \"https://registry.npmjs.org/css-loader/-/css-loader-2.1.1.tgz\",\n- \"integrity\": \"sha512-OcKJU/lt232vl1P9EEDamhoO9iKY3tIjY5GU+XDLblAykTdgs6Ux9P1hTHve8nFKy5KPpOXOsVI/hIwi3841+w==\",\n+ \"version\": \"3.5.3\",\n+ \"resolved\": \"https://registry.npmjs.org/css-loader/-/css-loader-3.5.3.tgz\",\n+ \"integrity\": \"sha512-UEr9NH5Lmi7+dguAm+/JSPovNjYbm2k3TK58EiwQHzOHH5Jfq1Y+XoP2bQO6TMn7PptMd0opxxedAWcaSTRKHw==\",\n\"dev\": true,\n\"requires\": {\n- \"camelcase\": \"^5.2.0\",\n- \"icss-utils\": \"^4.1.0\",\n+ \"camelcase\": \"^5.3.1\",\n+ \"cssesc\": \"^3.0.0\",\n+ \"icss-utils\": \"^4.1.1\",\n\"loader-utils\": \"^1.2.3\",\n\"normalize-path\": \"^3.0.0\",\n- \"postcss\": \"^7.0.14\",\n+ \"postcss\": \"^7.0.27\",\n\"postcss-modules-extract-imports\": \"^2.0.0\",\n- \"postcss-modules-local-by-default\": \"^2.0.6\",\n- \"postcss-modules-scope\": \"^2.1.0\",\n- \"postcss-modules-values\": \"^2.0.0\",\n- \"postcss-value-parser\": \"^3.3.0\",\n- \"schema-utils\": \"^1.0.0\"\n+ \"postcss-modules-local-by-default\": \"^3.0.2\",\n+ \"postcss-modules-scope\": \"^2.2.0\",\n+ \"postcss-modules-values\": \"^3.0.0\",\n+ \"postcss-value-parser\": \"^4.0.3\",\n+ \"schema-utils\": \"^2.6.6\",\n+ \"semver\": \"^6.3.0\"\n+ },\n+ \"dependencies\": {\n+ \"semver\": {\n+ \"version\": \"6.3.0\",\n+ \"resolved\": \"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz\",\n+ \"integrity\": \"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==\",\n+ \"dev\": true\n+ }\n}\n},\n\"cssesc\": {\n\"integrity\": \"sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==\",\n\"dev\": true\n},\n+ \"emojis-list\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz\",\n+ \"integrity\": \"sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==\",\n+ \"dev\": true\n+ },\n+ \"fast-deep-equal\": {\n+ \"version\": \"3.1.1\",\n+ \"resolved\": \"https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz\",\n+ \"integrity\": \"sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==\",\n+ \"dev\": true\n+ },\n\"file-loader\": {\n- \"version\": \"1.1.11\",\n- \"resolved\": \"https://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz\",\n- \"integrity\": \"sha512-TGR4HU7HUsGg6GCOPJnFk06RhWgEWFLAGWiT6rcD+GRC2keU3s9RGJ+b3Z6/U73jwwNb2gKLJ7YCrp+jvU4ALg==\",\n+ \"version\": \"6.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/file-loader/-/file-loader-6.0.0.tgz\",\n+ \"integrity\": \"sha512-/aMOAYEFXDdjG0wytpTL5YQLfZnnTmLNjn+AIrJ/6HVnTfDqLsVKUUwkDf4I4kgex36BvjuXEn/TX9B/1ESyqQ==\",\n\"dev\": true,\n\"requires\": {\n- \"loader-utils\": \"^1.0.2\",\n- \"schema-utils\": \"^0.4.5\"\n+ \"loader-utils\": \"^2.0.0\",\n+ \"schema-utils\": \"^2.6.5\"\n},\n\"dependencies\": {\n- \"schema-utils\": {\n- \"version\": \"0.4.7\",\n- \"resolved\": \"https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz\",\n- \"integrity\": \"sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==\",\n+ \"loader-utils\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz\",\n+ \"integrity\": \"sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==\",\n\"dev\": true,\n\"requires\": {\n- \"ajv\": \"^6.1.0\",\n- \"ajv-keywords\": \"^3.1.0\"\n+ \"big.js\": \"^5.2.2\",\n+ \"emojis-list\": \"^3.0.0\",\n+ \"json5\": \"^2.1.2\"\n}\n}\n}\n\"postcss\": \"^7.0.14\"\n}\n},\n+ \"json5\": {\n+ \"version\": \"2.1.3\",\n+ \"resolved\": \"https://registry.npmjs.org/json5/-/json5-2.1.3.tgz\",\n+ \"integrity\": \"sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"minimist\": \"^1.2.5\"\n+ }\n+ },\n\"mini-css-extract-plugin\": {\n\"version\": \"0.4.2\",\n\"resolved\": \"https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.4.2.tgz\",\n\"loader-utils\": \"^1.1.0\",\n\"schema-utils\": \"^1.0.0\",\n\"webpack-sources\": \"^1.1.0\"\n+ },\n+ \"dependencies\": {\n+ \"schema-utils\": {\n+ \"version\": \"1.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz\",\n+ \"integrity\": \"sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"ajv\": \"^6.1.0\",\n+ \"ajv-errors\": \"^1.0.0\",\n+ \"ajv-keywords\": \"^3.1.0\"\n+ }\n+ }\n+ }\n+ },\n+ \"postcss\": {\n+ \"version\": \"7.0.27\",\n+ \"resolved\": \"https://registry.npmjs.org/postcss/-/postcss-7.0.27.tgz\",\n+ \"integrity\": \"sha512-WuQETPMcW9Uf1/22HWUWP9lgsIC+KEHg2kozMflKjbeUtw9ujvFX6QmIfozaErDkmLWS9WEnEdEe6Uo9/BNTdQ==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"chalk\": \"^2.4.2\",\n+ \"source-map\": \"^0.6.1\",\n+ \"supports-color\": \"^6.1.0\"\n}\n},\n\"postcss-modules-extract-imports\": {\n}\n},\n\"postcss-modules-local-by-default\": {\n- \"version\": \"2.0.6\",\n- \"resolved\": \"https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-2.0.6.tgz\",\n- \"integrity\": \"sha512-oLUV5YNkeIBa0yQl7EYnxMgy4N6noxmiwZStaEJUSe2xPMcdNc8WmBQuQCx18H5psYbVxz8zoHk0RAAYZXP9gA==\",\n+ \"version\": \"3.0.2\",\n+ \"resolved\": \"https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.2.tgz\",\n+ \"integrity\": \"sha512-jM/V8eqM4oJ/22j0gx4jrp63GSvDH6v86OqyTHHUvk4/k1vceipZsaymiZ5PvocqZOl5SFHiFJqjs3la0wnfIQ==\",\n\"dev\": true,\n\"requires\": {\n- \"postcss\": \"^7.0.6\",\n- \"postcss-selector-parser\": \"^6.0.0\",\n- \"postcss-value-parser\": \"^3.3.1\"\n+ \"icss-utils\": \"^4.1.1\",\n+ \"postcss\": \"^7.0.16\",\n+ \"postcss-selector-parser\": \"^6.0.2\",\n+ \"postcss-value-parser\": \"^4.0.0\"\n}\n},\n\"postcss-modules-scope\": {\n- \"version\": \"2.1.1\",\n- \"resolved\": \"https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.1.1.tgz\",\n- \"integrity\": \"sha512-OXRUPecnHCg8b9xWvldG/jUpRIGPNRka0r4D4j0ESUU2/5IOnpsjfPPmDprM3Ih8CgZ8FXjWqaniK5v4rWt3oQ==\",\n+ \"version\": \"2.2.0\",\n+ \"resolved\": \"https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz\",\n+ \"integrity\": \"sha512-YyEgsTMRpNd+HmyC7H/mh3y+MeFWevy7V1evVhJWewmMbjDHIbZbOXICC2y+m1xI1UVfIT1HMW/O04Hxyu9oXQ==\",\n\"dev\": true,\n\"requires\": {\n\"postcss\": \"^7.0.6\",\n}\n},\n\"postcss-modules-values\": {\n- \"version\": \"2.0.0\",\n- \"resolved\": \"https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-2.0.0.tgz\",\n- \"integrity\": \"sha512-Ki7JZa7ff1N3EIMlPnGTZfUMe69FFwiQPnVSXC9mnn3jozCRBYIxiZd44yJOV2AmabOo4qFf8s0dC/+lweG7+w==\",\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz\",\n+ \"integrity\": \"sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg==\",\n\"dev\": true,\n\"requires\": {\n- \"icss-replace-symbols\": \"^1.1.0\",\n+ \"icss-utils\": \"^4.0.0\",\n\"postcss\": \"^7.0.6\"\n}\n},\n\"uniq\": \"^1.0.1\"\n}\n},\n+ \"postcss-value-parser\": {\n+ \"version\": \"4.0.3\",\n+ \"resolved\": \"https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.3.tgz\",\n+ \"integrity\": \"sha512-N7h4pG+Nnu5BEIzyeaaIYWs0LI5XC40OrRh5L60z0QjFsqGWcHcbkBvpe1WYpcIS9yQ8sOi/vIPt1ejQCrMVrg==\",\n+ \"dev\": true\n+ },\n+ \"schema-utils\": {\n+ \"version\": \"2.6.6\",\n+ \"resolved\": \"https://registry.npmjs.org/schema-utils/-/schema-utils-2.6.6.tgz\",\n+ \"integrity\": \"sha512-wHutF/WPSbIi9x6ctjGGk2Hvl0VOz5l3EKEuKbjPlB30mKZUzb9A5k9yEXRX3pwyqVLPvpfZZEllaFq/M718hA==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"ajv\": \"^6.12.0\",\n+ \"ajv-keywords\": \"^3.4.1\"\n+ }\n+ },\n\"semver\": {\n\"version\": \"5.7.1\",\n\"resolved\": \"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz\",\n\"integrity\": \"sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=\"\n},\n\"assets-webpack-plugin\": {\n- \"version\": \"3.9.10\",\n- \"resolved\": \"https://registry.npmjs.org/assets-webpack-plugin/-/assets-webpack-plugin-3.9.10.tgz\",\n- \"integrity\": \"sha512-aWmIi46fRhicSScuZ0n1Gk5c5vJehCihHm2L7nd7NdBqXWi5JRM+mREz/hmMay67fSRgXk5JEKFGAF1gE33z0Q==\",\n+ \"version\": \"3.9.12\",\n+ \"resolved\": \"https://registry.npmjs.org/assets-webpack-plugin/-/assets-webpack-plugin-3.9.12.tgz\",\n+ \"integrity\": \"sha512-iqXT/CtP013CO+IZJG7f4/KmUnde+nn6FSksAhrGRbT1GODsFU3xocP6A5NkTFoey3XOI9n1ZY0QmX/mY74gNA==\",\n\"dev\": true,\n\"requires\": {\n- \"camelcase\": \"^5.0.0\",\n- \"escape-string-regexp\": \"^1.0.3\",\n- \"lodash\": \"^4.17.10\",\n- \"mkdirp\": \"^0.5.1\"\n+ \"camelcase\": \"5.3.1\",\n+ \"escape-string-regexp\": \"2.0.0\",\n+ \"lodash\": \"4.17.15\",\n+ \"mkdirp\": \"0.5.3\"\n+ },\n+ \"dependencies\": {\n+ \"escape-string-regexp\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz\",\n+ \"integrity\": \"sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==\",\n+ \"dev\": true\n+ },\n+ \"mkdirp\": {\n+ \"version\": \"0.5.3\",\n+ \"resolved\": \"https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz\",\n+ \"integrity\": \"sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"minimist\": \"^1.2.5\"\n+ }\n+ }\n}\n},\n\"assign-symbols\": {\n},\n\"dependencies\": {\n\"ajv\": {\n- \"version\": \"6.12.0\",\n- \"resolved\": \"https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz\",\n- \"integrity\": \"sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==\",\n+ \"version\": \"6.12.2\",\n+ \"resolved\": \"https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz\",\n+ \"integrity\": \"sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==\",\n\"dev\": true,\n\"requires\": {\n\"fast-deep-equal\": \"^3.1.1\",\n}\n},\n\"schema-utils\": {\n- \"version\": \"2.6.5\",\n- \"resolved\": \"https://registry.npmjs.org/schema-utils/-/schema-utils-2.6.5.tgz\",\n- \"integrity\": \"sha512-5KXuwKziQrTVHh8j/Uxz+QUbxkaLW9X/86NBlx/gnKgtsZA2GIVMUn17qWhRFwF8jdYb3Dig5hRO/W5mZqy6SQ==\",\n+ \"version\": \"2.6.6\",\n+ \"resolved\": \"https://registry.npmjs.org/schema-utils/-/schema-utils-2.6.6.tgz\",\n+ \"integrity\": \"sha512-wHutF/WPSbIi9x6ctjGGk2Hvl0VOz5l3EKEuKbjPlB30mKZUzb9A5k9yEXRX3pwyqVLPvpfZZEllaFq/M718hA==\",\n\"dev\": true,\n\"requires\": {\n\"ajv\": \"^6.12.0\",\n\"dev\": true\n},\n\"style-loader\": {\n- \"version\": \"0.21.0\",\n- \"resolved\": \"https://registry.npmjs.org/style-loader/-/style-loader-0.21.0.tgz\",\n- \"integrity\": \"sha512-T+UNsAcl3Yg+BsPKs1vd22Fr8sVT+CJMtzqc6LEw9bbJZb43lm9GoeIfUcDEefBSWC0BhYbcdupV1GtI4DGzxg==\",\n+ \"version\": \"1.2.0\",\n+ \"resolved\": \"https://registry.npmjs.org/style-loader/-/style-loader-1.2.0.tgz\",\n+ \"integrity\": \"sha512-HC8WcGnjwNrKji7HSBqFOhGNUSt7UDU/jHxT6bA83Gk+JWJBmgitWlGihc0V1w6ZvwlzcX5LJOsofZzSP7b1tQ==\",\n\"dev\": true,\n\"requires\": {\n- \"loader-utils\": \"^1.1.0\",\n- \"schema-utils\": \"^0.4.5\"\n+ \"loader-utils\": \"^2.0.0\",\n+ \"schema-utils\": \"^2.6.6\"\n},\n\"dependencies\": {\n+ \"ajv\": {\n+ \"version\": \"6.12.2\",\n+ \"resolved\": \"https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz\",\n+ \"integrity\": \"sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"fast-deep-equal\": \"^3.1.1\",\n+ \"fast-json-stable-stringify\": \"^2.0.0\",\n+ \"json-schema-traverse\": \"^0.4.1\",\n+ \"uri-js\": \"^4.2.2\"\n+ }\n+ },\n+ \"emojis-list\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz\",\n+ \"integrity\": \"sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==\",\n+ \"dev\": true\n+ },\n+ \"fast-deep-equal\": {\n+ \"version\": \"3.1.1\",\n+ \"resolved\": \"https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz\",\n+ \"integrity\": \"sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==\",\n+ \"dev\": true\n+ },\n+ \"json5\": {\n+ \"version\": \"2.1.3\",\n+ \"resolved\": \"https://registry.npmjs.org/json5/-/json5-2.1.3.tgz\",\n+ \"integrity\": \"sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"minimist\": \"^1.2.5\"\n+ }\n+ },\n+ \"loader-utils\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz\",\n+ \"integrity\": \"sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"big.js\": \"^5.2.2\",\n+ \"emojis-list\": \"^3.0.0\",\n+ \"json5\": \"^2.1.2\"\n+ }\n+ },\n\"schema-utils\": {\n- \"version\": \"0.4.7\",\n- \"resolved\": \"https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz\",\n- \"integrity\": \"sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==\",\n+ \"version\": \"2.6.6\",\n+ \"resolved\": \"https://registry.npmjs.org/schema-utils/-/schema-utils-2.6.6.tgz\",\n+ \"integrity\": \"sha512-wHutF/WPSbIi9x6ctjGGk2Hvl0VOz5l3EKEuKbjPlB30mKZUzb9A5k9yEXRX3pwyqVLPvpfZZEllaFq/M718hA==\",\n\"dev\": true,\n\"requires\": {\n- \"ajv\": \"^6.1.0\",\n- \"ajv-keywords\": \"^3.1.0\"\n+ \"ajv\": \"^6.12.0\",\n+ \"ajv-keywords\": \"^3.4.1\"\n}\n}\n}\n}\n},\n\"yargs-parser\": {\n- \"version\": \"13.1.1\",\n- \"resolved\": \"https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz\",\n- \"integrity\": \"sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==\",\n+ \"version\": \"13.1.2\",\n+ \"resolved\": \"https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz\",\n+ \"integrity\": \"sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==\",\n\"dev\": true,\n\"requires\": {\n\"camelcase\": \"^5.0.0\",\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"@babel/polyfill\": \"^7.8.7\",\n\"@babel/preset-env\": \"^7.9.5\",\n\"@fortawesome/fontawesome-free\": \"^5.13.0\",\n- \"@symfony/webpack-encore\": \"^0.28.3\",\n+ \"@symfony/webpack-encore\": \"^0.29.1\",\n\"@vue/test-utils\": \"^1.0.0-beta.33\",\n\"ajv-keywords\": \"^3.4.1\",\n\"autoprefixer\": \"^9.7.6\",\n" } ]
PHP
MIT License
bolt/core
Updating symfony/webpack-encore to 0.29
95,144
27.04.2020 15:17:36
-7,200
ee131e5bac6e071c2370770c4f0acbf3c4bfbc8e
Better `isHomepage` detection for singletons
[ { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -738,11 +738,13 @@ class ContentExtension extends AbstractExtension\nforeach ($configSetting as $item) {\n$item = explode('/', $item);\n- if (empty($item[1])) {\n+ // Discard candidate if contentTypes don't match\n+ if ($item[0] !== $content->getContentTypeSingularSlug() && $item[0] !== $content->getContentTypeSlug()) {\ncontinue;\n}\n- if (($item[0] === $content->getContentTypeSingularSlug() || $item[0] === $content->getContentTypeSlug()) &&\n+ // Success if we either have no id/slug for a Singleton, or if the id/slug matches\n+ if ((empty($item[1]) && $content->getDefinition()->get('singleton')) ||\n($item[1] === $content->getSlug() || $item[1] === (string) $content->getId())) {\nreturn true;\n}\n" } ]
PHP
MIT License
bolt/core
Better `isHomepage` detection for singletons
95,144
29.04.2020 14:08:17
-7,200
3c56ce753d1a58e5ea3e38d703b48009eae0b72e
Fix flawed logic in Setcontent test page
[ { "change_type": "MODIFY", "old_path": "public/theme/skeleton/custom/setcontent_1.twig", "new_path": "public/theme/skeleton/custom/setcontent_1.twig", "diff": "{% for page in pages %}\n<li>\n{{ page.contenttype }} {{ page.id }} . {{ page|title }}\n- <span class=\"s{{ loop.index }}\">{{ _self.isbigger(page.id, last|default()) }}<span></span>\n+ <span class=\"s{{ loop.index }}\">{{ _self.isbigger(page.publishedAt, last|default()) }}<span></span>\n</li>\n- {% set last = page.id %}\n+ {% set last = page.publishedAt %}\n{% endfor %}\n</ul>\n</section>\n" } ]
PHP
MIT License
bolt/core
Fix flawed logic in Setcontent test page
95,144
03.05.2020 14:57:23
-7,200
cbf41e5e6e2d8a00072c4d5b9884255c381c489e
Updating some ECS settings
[ { "change_type": "MODIFY", "old_path": "easy-coding-standard.yml", "new_path": "easy-coding-standard.yml", "diff": "@@ -79,6 +79,8 @@ services:\nPhpCsFixer\\Fixer\\FunctionNotation\\PhpdocToReturnTypeFixer: ~\nPhpCsFixer\\Fixer\\Import\\FullyQualifiedStrictTypesFixer: ~\nPhpCsFixer\\Fixer\\Phpdoc\\NoSuperfluousPhpdocTagsFixer: ~\n+ PhpCsFixer\\Fixer\\Phpdoc\\PhpdocLineSpanFixer:\n+ property: single\n#please yoda no\nSlevomatCodingStandard\\Sniffs\\ControlStructures\\DisallowYodaComparisonSniff: ~\n@@ -98,3 +100,7 @@ parameters:\nSlevomatCodingStandard\\Sniffs\\TypeHints\\TypeHintDeclarationSniff: ~\nSymplify\\CodingStandard\\Sniffs\\Debug\\CommentedOutCodeSniff: ~ #to be removed before beta release\nSymplify\\CodingStandard\\Sniffs\\Debug\\DebugFunctionCallSniff: ~ #to be removed before beta release\n+\n+ # Deprecated. Todo: Find replacement\n+ Symplify\\CodingStandard\\Fixer\\ControlStructure\\RequireFollowedByAbsolutePathFixer: ~\n+ Symplify\\CodingStandard\\Fixer\\Property\\ArrayPropertyDefaultValueFixer: ~\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/ExtensionsController.php", "new_path": "src/Controller/Backend/ExtensionsController.php", "diff": "@@ -21,9 +21,7 @@ class ExtensionsController extends AbstractController implements BackendZoneInte\n/** @var ExtensionRegistry */\nprivate $extensionRegistry;\n- /**\n- * @var Dependencies\n- */\n+ /** @var Dependencies */\nprivate $dependenciesManager;\npublic function __construct(ExtensionRegistry $extensionRegistry)\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Field.php", "new_path": "src/Entity/Field.php", "diff": "@@ -54,14 +54,10 @@ class Field implements FieldInterface, TranslatableInterface\n*/\npublic $name;\n- /**\n- * @ORM\\Column(type=\"integer\")\n- */\n+ /** @ORM\\Column(type=\"integer\") */\nprivate $sortorder = 0;\n- /**\n- * @ORM\\Column(type=\"integer\", nullable=true)\n- */\n+ /** @ORM\\Column(type=\"integer\", nullable=true) */\nprivate $version;\n/**\n@@ -76,9 +72,7 @@ class Field implements FieldInterface, TranslatableInterface\n*/\nprivate $parent;\n- /**\n- * @var ?FieldType\n- */\n+ /** @var ?FieldType */\nprivate $fieldTypeDefinition;\npublic function __toString(): string\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/FieldTranslation.php", "new_path": "src/Entity/FieldTranslation.php", "diff": "@@ -21,9 +21,7 @@ class FieldTranslation implements TranslationInterface\n*/\nprivate $id;\n- /**\n- * @ORM\\Column(type=\"json\")\n- */\n+ /** @ORM\\Column(type=\"json\") */\nprotected $value = [];\npublic function getId(): ?int\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Log.php", "new_path": "src/Entity/Log.php", "diff": "@@ -20,49 +20,31 @@ class Log\n*/\nprivate $id;\n- /**\n- * @ORM\\Column(name=\"message\", type=\"text\")\n- */\n+ /** @ORM\\Column(name=\"message\", type=\"text\") */\nprivate $message;\n- /**\n- * @ORM\\Column(name=\"context\", type=\"array\", nullable=true)\n- */\n+ /** @ORM\\Column(name=\"context\", type=\"array\", nullable=true) */\nprivate $context;\n- /**\n- * @ORM\\Column(name=\"level\", type=\"smallint\")\n- */\n+ /** @ORM\\Column(name=\"level\", type=\"smallint\") */\nprivate $level;\n- /**\n- * @ORM\\Column(name=\"level_name\", type=\"string\", length=50)\n- */\n+ /** @ORM\\Column(name=\"level_name\", type=\"string\", length=50) */\nprivate $levelName;\n- /**\n- * @ORM\\Column(name=\"created_at\", type=\"datetime\")\n- */\n+ /** @ORM\\Column(name=\"created_at\", type=\"datetime\") */\nprivate $createdAt;\n- /**\n- * @ORM\\Column(name=\"extra\", type=\"array\", nullable=true)\n- */\n+ /** @ORM\\Column(name=\"extra\", type=\"array\", nullable=true) */\nprivate $extra;\n- /**\n- * @ORM\\Column(name=\"user\", type=\"array\", nullable=true)\n- */\n+ /** @ORM\\Column(name=\"user\", type=\"array\", nullable=true) */\nprivate $user;\n- /**\n- * @ORM\\Column(type=\"content\", type=\"integer\", nullable=true)\n- */\n+ /** @ORM\\Column(type=\"content\", type=\"integer\", nullable=true) */\nprivate $content;\n- /**\n- * @ORM\\Column(name=\"location\", type=\"array\", nullable=true)\n- */\n+ /** @ORM\\Column(name=\"location\", type=\"array\", nullable=true) */\nprivate $location;\n/**\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Media.php", "new_path": "src/Entity/Media.php", "diff": "@@ -19,54 +19,34 @@ class Media\n*/\nprivate $id;\n- /**\n- * @ORM\\Column(type=\"string\", length=191)\n- */\n+ /** @ORM\\Column(type=\"string\", length=191) */\nprivate $location;\n- /**\n- * @ORM\\Column(type=\"text\", length=1000)\n- */\n+ /** @ORM\\Column(type=\"text\", length=1000) */\nprivate $path;\n- /**\n- * @ORM\\Column(type=\"string\", length=191)\n- */\n+ /** @ORM\\Column(type=\"string\", length=191) */\nprivate $filename;\n- /**\n- * @ORM\\Column(type=\"string\", length=191)\n- */\n+ /** @ORM\\Column(type=\"string\", length=191) */\nprivate $type;\n- /**\n- * @ORM\\Column(type=\"integer\", nullable=true)\n- */\n+ /** @ORM\\Column(type=\"integer\", nullable=true) */\nprivate $width;\n- /**\n- * @ORM\\Column(type=\"integer\", nullable=true)\n- */\n+ /** @ORM\\Column(type=\"integer\", nullable=true) */\nprivate $height;\n- /**\n- * @ORM\\Column(type=\"integer\", nullable=true)\n- */\n+ /** @ORM\\Column(type=\"integer\", nullable=true) */\nprivate $filesize;\n- /**\n- * @ORM\\Column(type=\"integer\", nullable=true)\n- */\n+ /** @ORM\\Column(type=\"integer\", nullable=true) */\nprivate $cropX;\n- /**\n- * @ORM\\Column(type=\"integer\", nullable=true)\n- */\n+ /** @ORM\\Column(type=\"integer\", nullable=true) */\nprivate $cropY;\n- /**\n- * @ORM\\Column(type=\"float\", nullable=true)\n- */\n+ /** @ORM\\Column(type=\"float\", nullable=true) */\nprivate $cropZoom;\n/**\n@@ -77,34 +57,22 @@ class Media\n*/\nprivate $author;\n- /**\n- * @ORM\\Column(type=\"datetime\")\n- */\n+ /** @ORM\\Column(type=\"datetime\") */\nprivate $createdAt;\n- /**\n- * @ORM\\Column(type=\"datetime\")\n- */\n+ /** @ORM\\Column(type=\"datetime\") */\nprivate $modifiedAt;\n- /**\n- * @ORM\\Column(type=\"string\", length=191, nullable=true)\n- */\n+ /** @ORM\\Column(type=\"string\", length=191, nullable=true) */\nprivate $title;\n- /**\n- * @ORM\\Column(type=\"string\", length=1000, nullable=true)\n- */\n+ /** @ORM\\Column(type=\"string\", length=1000, nullable=true) */\nprivate $description;\n- /**\n- * @ORM\\Column(type=\"string\", length=1000, nullable=true)\n- */\n+ /** @ORM\\Column(type=\"string\", length=1000, nullable=true) */\nprivate $originalFilename;\n- /**\n- * @ORM\\Column(type=\"string\", length=191, nullable=true)\n- */\n+ /** @ORM\\Column(type=\"string\", length=191, nullable=true) */\nprivate $copyright;\npublic function __construct()\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Relation.php", "new_path": "src/Entity/Relation.php", "diff": "@@ -57,14 +57,10 @@ class Relation\n*/\nprivate $toContent;\n- /**\n- * @ORM\\Column(type=\"integer\")\n- */\n+ /** @ORM\\Column(type=\"integer\") */\nprivate $position = 0;\n- /**\n- * @ORM\\Column(name=\"`group`\", type=\"string\", length=191)\n- */\n+ /** @ORM\\Column(name=\"`group`\", type=\"string\", length=191) */\nprivate $group;\n/**\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Taxonomy.php", "new_path": "src/Entity/Taxonomy.php", "diff": "@@ -23,9 +23,7 @@ class Taxonomy\n*/\nprivate $id;\n- /**\n- * @ORM\\ManyToMany(targetEntity=\"Bolt\\Entity\\Content\", inversedBy=\"taxonomies\")\n- */\n+ /** @ORM\\ManyToMany(targetEntity=\"Bolt\\Entity\\Content\", inversedBy=\"taxonomies\") */\nprivate $content;\n/**\n@@ -52,9 +50,7 @@ class Taxonomy\n*/\nprivate $sortorder = 0;\n- /**\n- * @var string\n- */\n+ /** @var string */\nprivate $link;\npublic function __construct()\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/User.php", "new_path": "src/Entity/User.php", "diff": "@@ -86,9 +86,7 @@ class User implements UserInterface, \\Serializable\n*/\nprivate $lastseenAt;\n- /**\n- * @ORM\\Column(type=\"string\", length=100, nullable=true)\n- */\n+ /** @ORM\\Column(type=\"string\", length=100, nullable=true) */\nprivate $lastIp;\n/**\n@@ -97,19 +95,13 @@ class User implements UserInterface, \\Serializable\n*/\nprivate $locale;\n- /**\n- * @ORM\\Column(type=\"string\", length=191, nullable=true)\n- */\n+ /** @ORM\\Column(type=\"string\", length=191, nullable=true) */\nprivate $backendTheme;\n- /**\n- * @ORM\\Column(type=\"boolean\", options={\"default\" : false}, nullable=false)\n- */\n+ /** @ORM\\Column(type=\"boolean\", options={\"default\" : false}, nullable=false) */\nprivate $disabled = false;\n- /**\n- * @ORM\\OneToOne(targetEntity=\"Bolt\\Entity\\UserAuthToken\", mappedBy=\"user\", cascade={\"persist\", \"remove\"})\n- */\n+ /** @ORM\\OneToOne(targetEntity=\"Bolt\\Entity\\UserAuthToken\", mappedBy=\"user\", cascade={\"persist\", \"remove\"}) */\nprivate $userAuthToken;\npublic function __construct()\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/UserAuthToken.php", "new_path": "src/Entity/UserAuthToken.php", "diff": "@@ -18,19 +18,13 @@ class UserAuthToken\n*/\nprivate $id;\n- /**\n- * @ORM\\OneToOne(targetEntity=\"Bolt\\Entity\\User\", inversedBy=\"userAuthToken\", cascade={\"persist\"})\n- */\n+ /** @ORM\\OneToOne(targetEntity=\"Bolt\\Entity\\User\", inversedBy=\"userAuthToken\", cascade={\"persist\"}) */\nprivate $user;\n- /**\n- * @ORM\\Column(type=\"string\", length=255)\n- */\n+ /** @ORM\\Column(type=\"string\", length=255) */\nprivate $useragent;\n- /**\n- * @ORM\\Column(type=\"datetime\")\n- */\n+ /** @ORM\\Column(type=\"datetime\") */\nprivate $validity;\npublic function getId(): ?int\n" }, { "change_type": "MODIFY", "old_path": "src/Extension/ExtensionRegistry.php", "new_path": "src/Extension/ExtensionRegistry.php", "diff": "@@ -51,7 +51,9 @@ class ExtensionRegistry\nreturn array_unique($this->extensionClasses);\n}\n- /** @return ExtensionInterface[] */\n+ /**\n+ * @return ExtensionInterface[]\n+ */\npublic function getExtensions(): array\n{\nreturn $this->extensions;\n" } ]
PHP
MIT License
bolt/core
Updating some ECS settings
95,144
03.05.2020 15:00:18
-7,200
5dcd29d1737086465655c5a365a0572795e62a7f
Adding `ConcatSpaceFixer`
[ { "change_type": "MODIFY", "old_path": "easy-coding-standard.yml", "new_path": "easy-coding-standard.yml", "diff": "@@ -22,6 +22,8 @@ services:\n# Spaces\nSymplify\\CodingStandard\\Fixer\\Strict\\BlankLineAfterStrictTypesFixer: ~\n+ PhpCsFixer\\Fixer\\Operator\\ConcatSpaceFixer:\n+ spacing: one\n# Comments\nSymplify\\CodingStandard\\Fixer\\Commenting\\RemoveSuperfluousDocBlockWhitespaceFixer: ~\n@@ -91,7 +93,6 @@ parameters:\nPhpCsFixer\\Fixer\\ClassNotation\\ClassAttributesSeparationFixer: ~\nPhpCsFixer\\Fixer\\ClassNotation\\OrderedClassElementsFixer: ~\nPhpCsFixer\\Fixer\\ControlStructure\\YodaStyleFixer: ~\n- PhpCsFixer\\Fixer\\Operator\\ConcatSpaceFixer: ~\nPhpCsFixer\\Fixer\\Operator\\IncrementStyleFixer: ~\nPhpCsFixer\\Fixer\\Operator\\UnaryOperatorSpacesFixer: ~\nPhpCsFixer\\Fixer\\Phpdoc\\PhpdocAnnotationWithoutDotFixer: ~\n" } ]
PHP
MIT License
bolt/core
Adding `ConcatSpaceFixer`
95,144
03.05.2020 12:59:17
-7,200
a8070977599dcc74e584c14f599d4ed40dd4ab71
Add length attribute for `|title` filter
[ { "change_type": "MODIFY", "old_path": "src/Entity/ContentExtrasTrait.php", "new_path": "src/Entity/ContentExtrasTrait.php", "diff": "@@ -31,7 +31,7 @@ trait ContentExtrasTrait\n$content = $this;\nreturn array_filter([\n- 'title' => $this->contentExtension->getAnyTitle($content),\n+ 'title' => $this->contentExtension->getAnyTitle($content, 80),\n'image' => $this->contentExtension->getImage($content, true),\n'excerpt' => $this->contentExtension->getExcerpt($content),\n'link' => $this->contentExtension->getLink($content),\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -141,9 +141,9 @@ class ContentExtension extends AbstractExtension\n];\n}\n- public function getAnyTitle(Content $content): string\n+ public function getAnyTitle(Content $content, int $length = 120): string\n{\n- $title = $this->getTitle($content);\n+ $title = $this->getTitle($content, '', $length);\nif (! empty($title)) {\nreturn $title;\n@@ -153,7 +153,7 @@ class ContentExtension extends AbstractExtension\n$locales = $content->getDefinition()->get('locales');\nforeach ($locales as $locale) {\n- $title = $this->getTitle($content, $locale);\n+ $title = $this->getTitle($content, $locale, $length);\nif (! empty($title)) {\nreturn $title;\n@@ -164,7 +164,7 @@ class ContentExtension extends AbstractExtension\nreturn '';\n}\n- public function getTitle(Content $content, string $locale = ''): string\n+ public function getTitle(Content $content, string $locale = '', int $length = 120): string\n{\n$titleParts = [];\n@@ -184,9 +184,7 @@ class ContentExtension extends AbstractExtension\n$titleParts[] = $value;\n}\n- $maxLength = 80; // Should we make this configurable, or is that overkill?\n-\n- return Html::trimText(implode(' ', $titleParts), $maxLength);\n+ return Html::trimText(implode(' ', $titleParts), $length);\n}\npublic function guessTitleFields(Content $content): array\n" } ]
PHP
MIT License
bolt/core
Add length attribute for `|title` filter
95,144
03.05.2020 14:15:39
-7,200
8ef74777a09204aaef99cd0f304953eb5318dd6a
Improve `title_format` and add `excerpt_format` attributes in ContentTypes
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/ContentTypesParser.php", "new_path": "src/Configuration/Parser/ContentTypesParser.php", "diff": "@@ -178,7 +178,7 @@ class ContentTypesParser extends BaseParser\n// Make sure title_format is set\nif (isset($contentType['title_format'])) {\n- $contentType['title_format'] = (array) $contentType['title_format'];\n+ $contentType['title_format'] = $contentType['title_format'];\n} elseif (isset($contentType['fields']['slug']['uses'])) {\n$contentType['title_format'] = (array) $contentType['fields']['slug']['uses'];\n} else {\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -102,7 +102,7 @@ class ContentExtension extends AbstractExtension\nreturn [\nnew TwigFilter('title', [$this, 'getTitle'], $safe),\n- new TwigFilter('title_fields', [$this, 'guessTitleFields']),\n+ new TwigFilter('title_fields', [$this, 'TitleFields']),\nnew TwigFilter('image', [$this, 'getImage']),\nnew TwigFilter('excerpt', [$this, 'getExcerpt'], $safe),\nnew TwigFilter('previous', [$this, 'getPreviousContent']),\n@@ -165,10 +165,21 @@ class ContentExtension extends AbstractExtension\n}\npublic function getTitle(Content $content, string $locale = '', int $length = 120): string\n+ {\n+ if (ComposeValueHelper::isSuitable($content)) {\n+ $title = ComposeValueHelper::get($content, $content->getDefinition()->get('title_format'));\n+ } else {\n+ $title = $this->getFieldBasedTitle($content);\n+ }\n+\n+ return Html::trimText($title, $length);\n+ }\n+\n+ private function getFieldBasedTitle(Content $content): string\n{\n$titleParts = [];\n- foreach ($this->guessTitleFields($content) as $fieldName) {\n+ foreach (ComposeValueHelper::guessTitleFields($content) as $fieldName) {\n$field = $content->getField($fieldName);\nif (! empty($locale)) {\n@@ -184,53 +195,16 @@ class ContentExtension extends AbstractExtension\n$titleParts[] = $value;\n}\n- return Html::trimText(implode(' ', $titleParts), $length);\n+ return implode(' ', $titleParts);\n}\n- public function guessTitleFields(Content $content): array\n+ public function getTitleFields(Content $content): array\n{\n- $definition = $content->getDefinition();\n-\n- // First, see if we have a \"title format\" in the Content Type.\n- if ($definition !== null && $definition->has('title_format')) {\n- $names = $definition->get('title_format');\n-\n- $namesCollection = Collection::wrap($names)->filter(function (string $name) use ($content): bool {\n- if ($content->hasFieldDefined($name) === false) {\n- throw new \\RuntimeException(sprintf(\n- \"Content '%s' has field '%s' added to title_format config option, but the field is not present in Content's definition.\",\n- $content->getContentTypeName(),\n- $name\n- ));\n- }\n-\n- return $content->hasField($name);\n- });\n-\n- if ($namesCollection->isNotEmpty()) {\n- return $namesCollection->values()->toArray();\n- }\n- }\n-\n- // Alternatively, see if we have a field named 'title' or somesuch.\n- $names = ['title', 'name', 'caption', 'subject']; // English\n- $names = array_merge($names, ['titel', 'naam', 'kop', 'onderwerp']); // Dutch\n- $names = array_merge($names, ['nom', 'sujet']); // French\n- $names = array_merge($names, ['nombre', 'sujeto']); // Spanish\n-\n- foreach ($names as $name) {\n- if ($content->hasField($name)) {\n- return (array) $name;\n- }\n- }\n-\n- foreach ($content->getFields() as $field) {\n- if ($field instanceof Excerptable) {\n- return (array) $field->getName();\n- }\n+ if (ComposeValueHelper::isSuitable($content)) {\n+ return ComposeValueHelper::getFieldNames($content->getDefinition()->get('title_format'));\n}\n- return [];\n+ return ComposeValueHelper::guessTitleFields($content);\n}\n/**\n@@ -279,7 +253,7 @@ class ContentExtension extends AbstractExtension\n}\n}\n- $skipFields = $this->guessTitleFields($content);\n+ $skipFields = ComposeValueHelper::guessTitleFields($content);\nforeach ($content->getFields() as $field) {\nif ($field instanceof Excerptable && in_array($field->getName(), $skipFields, true) === false) {\n" }, { "change_type": "MODIFY", "old_path": "src/Utils/ComposeValueHelper.php", "new_path": "src/Utils/ComposeValueHelper.php", "diff": "@@ -5,9 +5,25 @@ declare(strict_types=1);\nnamespace Bolt\\Utils;\nuse Bolt\\Entity\\Content;\n+use Bolt\\Entity\\Field\\Excerptable;\n+use Tightenco\\Collect\\Support\\Collection;\nclass ComposeValueHelper\n{\n+ public static function isSuitable(Content $record): bool\n+ {\n+ $definition = $record->getDefinition();\n+\n+ if ($definition !== null && $definition->has('title_format')) {\n+ $format = $definition->get('title_format');\n+ if (is_string($format) && strpos($format, '{') !== false) {\n+ return true;\n+ }\n+ }\n+\n+ return false;\n+ }\n+\npublic static function get(Content $record, string $format = '', string $locale = ''): string\n{\nif (empty($format)) {\n@@ -48,4 +64,63 @@ class ComposeValueHelper\n$format\n);\n}\n+\n+ public static function getFieldNames(string $format): array\n+ {\n+ $res = preg_match_all('/{([\\w]+)}/i', $format, $matches);\n+\n+ dump($matches[1]);\n+ return $matches[1];\n+ }\n+\n+\n+ public static function guessTitleFields(Content $content): array\n+ {\n+ $definition = $content->getDefinition();\n+\n+ // First, see if we have a \"title format\" in the Content Type.\n+ if ($definition !== null && $definition->has('title_format')) {\n+\n+ if (ComposeValueHelper::isSuitable($content)) {\n+ $names = ComposeValueHelper::getFieldNames($definition->get('title_format'));\n+ } else {\n+ $names = $definition->get('title_format');\n+ }\n+\n+ $namesCollection = Collection::wrap($names)->filter(function (string $name) use ($content): bool {\n+ if ($content->hasFieldDefined($name) === false) {\n+ throw new \\RuntimeException(sprintf(\n+ \"Content '%s' has field '%s' added to title_format config option, but the field is not present in Content's definition.\",\n+ $content->getContentTypeName(),\n+ $name\n+ ));\n+ }\n+ return $content->hasField($name);\n+ });\n+\n+ if ($namesCollection->isNotEmpty()) {\n+ return $namesCollection->values()->toArray();\n+ }\n+ }\n+\n+ // Alternatively, see if we have a field named 'title' or somesuch.\n+ $names = ['title', 'name', 'caption', 'subject']; // English\n+ $names = array_merge($names, ['titel', 'naam', 'kop', 'onderwerp']); // Dutch\n+ $names = array_merge($names, ['nom', 'sujet']); // French\n+ $names = array_merge($names, ['nombre', 'sujeto']); // Spanish\n+\n+ foreach ($names as $name) {\n+ if ($content->hasField($name)) {\n+ return (array) $name;\n+ }\n+ }\n+\n+ foreach ($content->getFields() as $field) {\n+ if ($field instanceof Excerptable) {\n+ return (array) $field->getName();\n+ }\n+ }\n+\n+ return [];\n+ }\n}\n" } ]
PHP
MIT License
bolt/core
Improve `title_format` and add `excerpt_format` attributes in ContentTypes
95,144
03.05.2020 15:56:23
-7,200
ceb83b1dbdc712ec407690b40ec521d3173e2a81
Allow `excerpt_format`
[ { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -242,6 +242,17 @@ class ContentExtension extends AbstractExtension\nreturn Excerpt::getExcerpt((string) $content, $length);\n}\n+ if (ComposeValueHelper::isSuitable($content, 'excerpt_format')) {\n+ $excerpt = ComposeValueHelper::get($content, $content->getDefinition()->get('excerpt_format'));\n+ } else {\n+ $excerpt = $this->getFieldBasedExcerpt($content, $includeTitle);\n+ }\n+\n+ return Excerpt::getExcerpt(rtrim($excerpt, '. '), $length, $focus);\n+ }\n+\n+ private function getFieldBasedExcerpt(Content $content, bool $includeTitle = false): string\n+ {\n$excerptParts = [];\nif ($includeTitle) {\n@@ -274,7 +285,7 @@ class ContentExtension extends AbstractExtension\nreturn $excerpt . $part . ' ';\n}, '');\n- return Excerpt::getExcerpt(rtrim($excerpt, '. '), $length, $focus);\n+ return rtrim($excerpt, '. ');\n}\npublic function getPreviousContent(Content $content, string $byColumn = 'id', bool $sameContentType = true): ?Content\n" }, { "change_type": "MODIFY", "old_path": "src/Utils/ComposeValueHelper.php", "new_path": "src/Utils/ComposeValueHelper.php", "diff": "@@ -10,12 +10,12 @@ use Tightenco\\Collect\\Support\\Collection;\nclass ComposeValueHelper\n{\n- public static function isSuitable(Content $record): bool\n+ public static function isSuitable(Content $record, string $which = 'title_format'): bool\n{\n$definition = $record->getDefinition();\n- if ($definition !== null && $definition->has('title_format')) {\n- $format = $definition->get('title_format');\n+ if ($definition !== null && $definition->has($which)) {\n+ $format = $definition->get($which);\nif (is_string($format) && strpos($format, '{') !== false) {\nreturn true;\n}\n" } ]
PHP
MIT License
bolt/core
Allow `excerpt_format`
95,144
17.05.2020 12:19:04
-7,200
0d7ba6fa46a3fcc11e459d0f305b22050ff3c8a1
Composer dep updates
[ { "change_type": "MODIFY", "old_path": "config/bundles.php", "new_path": "config/bundles.php", "diff": "@@ -21,6 +21,7 @@ return [\nSymfony\\Bundle\\WebProfilerBundle\\WebProfilerBundle::class => ['dev' => true, 'local' => true],\nSymfony\\Bundle\\WebServerBundle\\WebServerBundle::class => ['dev' => true, 'test' => true, 'local' => true],\nSymfony\\WebpackEncoreBundle\\WebpackEncoreBundle::class => ['all' => true],\n+ Symplify\\ParameterNameGuard\\ParameterNameGuardBundle::class => ['dev' => true, 'test' => true],\nTranslation\\Bundle\\TranslationBundle::class => ['all' => true],\nTranslation\\PlatformAdapter\\Loco\\Bridge\\Symfony\\TranslationAdapterLocoBundle::class => ['dev' => true, 'local' => true],\nWhiteOctober\\PagerfantaBundle\\WhiteOctoberPagerfantaBundle::class => ['all' => true],\n" }, { "change_type": "MODIFY", "old_path": "symfony.lock", "new_path": "symfony.lock", "diff": "\"symplify/package-builder\": {\n\"version\": \"v7.2.2\"\n},\n+ \"symplify/parameter-name-guard\": {\n+ \"version\": \"v7.3.18\"\n+ },\n\"symplify/set-config-resolver\": {\n\"version\": \"v7.2.2\"\n},\n" } ]
PHP
MIT License
bolt/core
Composer dep updates
95,144
21.05.2020 13:16:59
-7,200
c86c75b536e5e22830ad6490e331d06db33ef04d
Don't "kill" process
[ { "change_type": "MODIFY", "old_path": "Makefile", "new_path": "Makefile", "diff": "@@ -82,7 +82,7 @@ behat-js: ## to run behat JS tests\nvendor/bin/selenium-server-standalone >/dev/null 2>&1 &\nsleep 2s\nvendor/bin/behat --tags=javascript\n- kill -9 $(lsof -t -i:4444)\n+ # kill -9 $(lsof -t -i:4444)\nbehat-js-quiet: ## to run behat JS tests quietly\nmake server\n@@ -92,7 +92,7 @@ behat-js-quiet: ## to run behat JS tests quietly\nvendor/bin/selenium-server-standalone >/dev/null 2>&1 &\nsleep 2s\nvendor/bin/behat --tags=javascript --format=progress\n- kill -9 $(lsof -t -i:4444)\n+ # kill -9 $(lsof -t -i:4444)\nbehat:\nmake behat-api\n" } ]
PHP
MIT License
bolt/core
Don't "kill" process
95,144
19.05.2020 17:38:48
-7,200
9fdd7500365afce8929c13c7f2d9446154a2be31
Break slightly less when adding new contenttypes
[ { "change_type": "MODIFY", "old_path": "public/theme/skeleton/partials/_aside.twig", "new_path": "public/theme/skeleton/partials/_aside.twig", "diff": "{% setcontent records = ct.slug ~ \"/latest/3\" %}\n<h5>{{ __('contenttypes.generic.recent', {'%contenttypes%': ct.name}) }}</h5>\n+ {% if records|length %}\n<ul>\n{% for record in records %}\n<li><a href=\"{{ record|link }}\">{{ record|title }}</a></li>\n- {% else %}\n- <li>{{ __('contenttypes.generic.no-recent', {'%contenttype%': ct.slug}) }}</li>\n{% endfor %}\n</ul>\n<p><a href=\"{{ path('listing', {'contentTypeSlug': ct.slug}) }}\">{{ __('contenttypes.generic.overview',{'%contenttypes%': ct.name}) }} &raquo;</a></p>\n+ {% else %}\n+ <p>{{ __('contenttypes.generic.no-recent', {'%contenttype%': ct.slug}) }}</p>\n+ {% endif %}\n{% endfor %}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_buttons.html.twig", "new_path": "templates/content/_buttons.html.twig", "diff": "<hr>\n<div class=\"form-fieldsgroup__summary-fields\">\n- {% if record.status == \"published\" and record.definition.viewless != true %}\n+ {% if record.status == \"published\" and record|link(true) %}\n<a href=\"{{ record|link(true) }}\" class=\"btn btn-tertiary btn-sm\" target=\"_blank\">{{ macro.icon('fa-sign-out-alt') }} {{ __('action.view_saved') }}</a>\n{% endif %}\n<a href=\"{{ record.extras.deleteLink }}\" class='action-remove-collection-item btn btn-sm btn-hidden-danger' data-confirmation=\"{{ 'action.confirm_delete'|trans }}\">\n" } ]
PHP
MIT License
bolt/core
Break slightly less when adding new contenttypes
95,144
22.05.2020 07:42:06
-7,200
dee17bc4fd663216b1a08bfb1afb01e4ee943a6a
Add Configuration Notices extension
[ { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"behat/mink-selenium2-driver\": \"^1.3\",\n\"behat/symfony2-extension\": \"^2.1\",\n\"behatch/contexts\": \"^3.2\",\n+ \"bobdenotter/configuration-notices\": \"^1.0\",\n\"bobdenotter/weatherwidget\": \"^1.0\",\n\"bolt/newswidget\": \"^1.1\",\n\"coduo/php-matcher\": \"^4.0\",\n" }, { "change_type": "ADD", "old_path": null, "new_path": "config/extensions/bobdenotter-configurationnotices.yaml", "diff": "+# Settings for Bolt Configuration Notices\n+\n+local_domains: [ '.foo' ]\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "config/services_bolt.yaml", "new_path": "config/services_bolt.yaml", "diff": "@@ -13,3 +13,6 @@ services:\nBolt\\NewsWidget\\:\nresource: '../vendor/bolt/newswidget/src/*'\nexclude: '../vendor/bolt/newswidget/src/{Entity,Exception}'\n+ BobdenOtter\\ConfigurationNotices\\:\n+ resource: '../vendor/bobdenotter/configuration-notices/src/*'\n+ exclude: '../vendor/bobdenotter/configuration-notices/src/{Entity,Exception}'\n" }, { "change_type": "MODIFY", "old_path": "src/Extension/ServicesTrait.php", "new_path": "src/Extension/ServicesTrait.php", "diff": "@@ -10,6 +10,8 @@ use Bolt\\Widgets;\nuse Doctrine\\ORM\\EntityManagerInterface;\nuse Psr\\Container\\ContainerInterface;\nuse Psr\\Log\\LoggerInterface;\n+use Symfony\\Component\\HttpFoundation\\Request;\n+use Symfony\\Component\\HttpFoundation\\RequestStack;\nuse Symfony\\Component\\HttpFoundation\\Session\\Session;\nuse Symfony\\Component\\Stopwatch\\Stopwatch;\nuse Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface;\n@@ -123,4 +125,12 @@ trait ServicesTrait\n{\nreturn $this->query;\n}\n+\n+ public function getRequest(): Request\n+ {\n+ /** @var RequestStack $stack */\n+ $stack = $this->getService('request_stack');\n+\n+ return $stack->getCurrentRequest();\n+ }\n}\n" } ]
PHP
MIT License
bolt/core
Add Configuration Notices extension
95,144
22.05.2020 17:55:02
-7,200
e65878652c7e4f6730d927fdc2463cf5bcef161c
Working on Skeleton Theme (New.css instead of Sakura)
[ { "change_type": "DELETE", "old_path": "public/theme/skeleton/css/normalize.css", "new_path": null, "diff": "-/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n-\n-/* Document\n- ========================================================================== */\n-\n-/**\n- * 1. Correct the line height in all browsers.\n- * 2. Prevent adjustments of font size after orientation changes in iOS.\n- */\n-\n-html {\n- line-height: 1.15; /* 1 */\n- -webkit-text-size-adjust: 100%; /* 2 */\n-}\n-\n-/* Sections\n- ========================================================================== */\n-\n-/**\n- * Remove the margin in all browsers.\n- */\n-\n-body {\n- margin: 0;\n-}\n-\n-/**\n- * Render the `main` element consistently in IE.\n- */\n-\n-main {\n- display: block;\n-}\n-\n-/**\n- * Correct the font size and margin on `h1` elements within `section` and\n- * `article` contexts in Chrome, Firefox, and Safari.\n- */\n-\n-h1 {\n- font-size: 2em;\n- margin: 0.67em 0;\n-}\n-\n-/* Grouping content\n- ========================================================================== */\n-\n-/**\n- * 1. Add the correct box sizing in Firefox.\n- * 2. Show the overflow in Edge and IE.\n- */\n-\n-hr {\n- box-sizing: content-box; /* 1 */\n- height: 0; /* 1 */\n- overflow: visible; /* 2 */\n-}\n-\n-/**\n- * 1. Correct the inheritance and scaling of font size in all browsers.\n- * 2. Correct the odd `em` font sizing in all browsers.\n- */\n-\n-pre {\n- font-family: monospace, monospace; /* 1 */\n- font-size: 1em; /* 2 */\n-}\n-\n-/* Text-level semantics\n- ========================================================================== */\n-\n-/**\n- * Remove the gray background on active links in IE 10.\n- */\n-\n-a {\n- background-color: transparent;\n-}\n-\n-/**\n- * 1. Remove the bottom border in Chrome 57-\n- * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n- */\n-\n-abbr[title] {\n- border-bottom: none; /* 1 */\n- text-decoration: underline; /* 2 */\n- text-decoration: underline dotted; /* 2 */\n-}\n-\n-/**\n- * Add the correct font weight in Chrome, Edge, and Safari.\n- */\n-\n-b,\n-strong {\n- font-weight: bolder;\n-}\n-\n-/**\n- * 1. Correct the inheritance and scaling of font size in all browsers.\n- * 2. Correct the odd `em` font sizing in all browsers.\n- */\n-\n-code,\n-kbd,\n-samp {\n- font-family: monospace, monospace; /* 1 */\n- font-size: 1em; /* 2 */\n-}\n-\n-/**\n- * Add the correct font size in all browsers.\n- */\n-\n-small {\n- font-size: 80%;\n-}\n-\n-/**\n- * Prevent `sub` and `sup` elements from affecting the line height in\n- * all browsers.\n- */\n-\n-sub,\n-sup {\n- font-size: 75%;\n- line-height: 0;\n- position: relative;\n- vertical-align: baseline;\n-}\n-\n-sub {\n- bottom: -0.25em;\n-}\n-\n-sup {\n- top: -0.5em;\n-}\n-\n-/* Embedded content\n- ========================================================================== */\n-\n-/**\n- * Remove the border on images inside links in IE 10.\n- */\n-\n-img {\n- border-style: none;\n-}\n-\n-/* Forms\n- ========================================================================== */\n-\n-/**\n- * 1. Change the font styles in all browsers.\n- * 2. Remove the margin in Firefox and Safari.\n- */\n-\n-button,\n-input,\n-optgroup,\n-select,\n-textarea {\n- font-family: inherit; /* 1 */\n- font-size: 100%; /* 1 */\n- line-height: 1.15; /* 1 */\n- margin: 0; /* 2 */\n-}\n-\n-/**\n- * Show the overflow in IE.\n- * 1. Show the overflow in Edge.\n- */\n-\n-button,\n-input { /* 1 */\n- overflow: visible;\n-}\n-\n-/**\n- * Remove the inheritance of text transform in Edge, Firefox, and IE.\n- * 1. Remove the inheritance of text transform in Firefox.\n- */\n-\n-button,\n-select { /* 1 */\n- text-transform: none;\n-}\n-\n-/**\n- * Correct the inability to style clickable types in iOS and Safari.\n- */\n-\n-button,\n-[type=\"button\"],\n-[type=\"reset\"],\n-[type=\"submit\"] {\n- -webkit-appearance: button;\n-}\n-\n-/**\n- * Remove the inner border and padding in Firefox.\n- */\n-\n-button::-moz-focus-inner,\n-[type=\"button\"]::-moz-focus-inner,\n-[type=\"reset\"]::-moz-focus-inner,\n-[type=\"submit\"]::-moz-focus-inner {\n- border-style: none;\n- padding: 0;\n-}\n-\n-/**\n- * Restore the focus styles unset by the previous rule.\n- */\n-\n-button:-moz-focusring,\n-[type=\"button\"]:-moz-focusring,\n-[type=\"reset\"]:-moz-focusring,\n-[type=\"submit\"]:-moz-focusring {\n- outline: 1px dotted ButtonText;\n-}\n-\n-/**\n- * Correct the padding in Firefox.\n- */\n-\n-fieldset {\n- padding: 0.35em 0.75em 0.625em;\n-}\n-\n-/**\n- * 1. Correct the text wrapping in Edge and IE.\n- * 2. Correct the color inheritance from `fieldset` elements in IE.\n- * 3. Remove the padding so developers are not caught out when they zero out\n- * `fieldset` elements in all browsers.\n- */\n-\n-legend {\n- box-sizing: border-box; /* 1 */\n- color: inherit; /* 2 */\n- display: table; /* 1 */\n- max-width: 100%; /* 1 */\n- padding: 0; /* 3 */\n- white-space: normal; /* 1 */\n-}\n-\n-/**\n- * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n- */\n-\n-progress {\n- vertical-align: baseline;\n-}\n-\n-/**\n- * Remove the default vertical scrollbar in IE 10+.\n- */\n-\n-textarea {\n- overflow: auto;\n-}\n-\n-/**\n- * 1. Add the correct box sizing in IE 10.\n- * 2. Remove the padding in IE 10.\n- */\n-\n-[type=\"checkbox\"],\n-[type=\"radio\"] {\n- box-sizing: border-box; /* 1 */\n- padding: 0; /* 2 */\n-}\n-\n-/**\n- * Correct the cursor style of increment and decrement buttons in Chrome.\n- */\n-\n-[type=\"number\"]::-webkit-inner-spin-button,\n-[type=\"number\"]::-webkit-outer-spin-button {\n- height: auto;\n-}\n-\n-/**\n- * 1. Correct the odd appearance in Chrome and Safari.\n- * 2. Correct the outline style in Safari.\n- */\n-\n-[type=\"search\"] {\n- -webkit-appearance: textfield; /* 1 */\n- outline-offset: -2px; /* 2 */\n-}\n-\n-/**\n- * Remove the inner padding in Chrome and Safari on macOS.\n- */\n-\n-[type=\"search\"]::-webkit-search-decoration {\n- -webkit-appearance: none;\n-}\n-\n-/**\n- * 1. Correct the inability to style clickable types in iOS and Safari.\n- * 2. Change font properties to `inherit` in Safari.\n- */\n-\n-::-webkit-file-upload-button {\n- -webkit-appearance: button; /* 1 */\n- font: inherit; /* 2 */\n-}\n-\n-/* Interactive\n- ========================================================================== */\n-\n-/*\n- * Add the correct display in Edge, IE 10+, and Firefox.\n- */\n-\n-details {\n- display: block;\n-}\n-\n-/*\n- * Add the correct display in all browsers.\n- */\n-\n-summary {\n- display: list-item;\n-}\n-\n-/* Misc\n- ========================================================================== */\n-\n-/**\n- * Add the correct display in IE 10+.\n- */\n-\n-template {\n- display: none;\n-}\n-\n-/**\n- * Add the correct display in IE 10.\n- */\n-\n-[hidden] {\n- display: none;\n-}\n" }, { "change_type": "DELETE", "old_path": "public/theme/skeleton/css/sakura.css", "new_path": null, "diff": "-/* Sakura.css v1.0.0\n- * ================\n- * Minimal css theme.\n- * Project: https://github.com/oxalorg/sakura\n- */\n-/* Body */\n-html {\n- font-size: 62.5%;\n- font-family: serif; }\n-\n-body {\n- font-size: 1.8rem;\n- line-height: 1.618;\n- max-width: 38em;\n- margin: auto;\n- color: #4a4a4a;\n- background-color: #f9f9f9;\n- padding: 13px; }\n-\n-@media (max-width: 684px) {\n- body {\n- font-size: 1.53rem; } }\n-\n-@media (max-width: 382px) {\n- body {\n- font-size: 1.35rem; } }\n-\n-h1, h2, h3, h4, h5, h6 {\n- line-height: 1.1;\n- font-family: Verdana, Geneva, sans-serif;\n- font-weight: 700;\n- overflow-wrap: break-word;\n- word-wrap: break-word;\n- -ms-word-break: break-all;\n- word-break: break-word;\n- -ms-hyphens: auto;\n- -moz-hyphens: auto;\n- -webkit-hyphens: auto;\n- hyphens: auto; }\n-\n-h1 {\n- font-size: 2.35em; }\n-\n-h2 {\n- font-size: 2.00em; }\n-\n-h3 {\n- font-size: 1.75em; }\n-\n-h4 {\n- font-size: 1.5em; }\n-\n-h5 {\n- font-size: 1.25em; }\n-\n-h6 {\n- font-size: 1em; }\n-\n-small, sub, sup {\n- font-size: 75%; }\n-\n-hr {\n- border-color: #2c8898; }\n-\n-a {\n- text-decoration: none;\n- color: #2c8898; }\n- a:hover {\n- color: #982c61;\n- border-bottom: 2px solid #4a4a4a; }\n-\n-ul {\n- padding-left: 1.4em; }\n-\n-li {\n- margin-bottom: 0.4em; }\n-\n-blockquote {\n- font-style: italic;\n- margin-left: 1.5em;\n- padding-left: 1em;\n- border-left: 3px solid #2c8898; }\n-\n-img {\n- max-width: 100%;\n- display: block;\n-}\n-\n-/* Pre and Code */\n-pre {\n- background-color: #f1f1f1;\n- display: block;\n- padding: 1em;\n- overflow-x: auto; }\n-\n-code {\n- font-size: 0.9em;\n- padding: 0 0.5em;\n- background-color: #f1f1f1;\n- white-space: pre-wrap; }\n-\n-pre > code {\n- padding: 0;\n- background-color: transparent;\n- white-space: pre; }\n-\n-/* Tables */\n-table {\n- text-align: justify;\n- width: 100%;\n- border-collapse: collapse; }\n-\n-td, th {\n- padding: 0.5em;\n- border-bottom: 1px solid #f1f1f1; }\n-\n-/* Buttons, forms and input */\n-input, textarea {\n- border: 1px solid #4a4a4a; }\n- input:focus, textarea:focus {\n- border: 1px solid #2c8898; }\n-\n-textarea {\n- width: 100%; }\n-\n-.button, button, input[type=\"submit\"], input[type=\"reset\"], input[type=\"button\"] {\n- display: inline-block;\n- padding: 5px 10px;\n- text-align: center;\n- text-decoration: none;\n- white-space: nowrap;\n- background-color: #2c8898;\n- color: #f9f9f9;\n- border-radius: 1px;\n- border: 1px solid #2c8898;\n- cursor: pointer;\n- box-sizing: border-box; }\n- .button[disabled], button[disabled], input[type=\"submit\"][disabled], input[type=\"reset\"][disabled], input[type=\"button\"][disabled] {\n- cursor: default;\n- opacity: .5; }\n- .button:focus, .button:hover, button:focus, button:hover, input[type=\"submit\"]:focus, input[type=\"submit\"]:hover, input[type=\"reset\"]:focus, input[type=\"reset\"]:hover, input[type=\"button\"]:focus, input[type=\"button\"]:hover {\n- background-color: #982c61;\n- border-color: #982c61;\n- color: #f9f9f9;\n- outline: 0; }\n-\n-textarea, select, input[type] {\n- color: #4a4a4a;\n- padding: 6px 10px;\n- /* The 6px vertically centers text on FF, ignored by Webkit */\n- margin-bottom: 10px;\n- background-color: #f1f1f1;\n- border: 1px solid #f1f1f1;\n- border-radius: 4px;\n- box-shadow: none;\n- box-sizing: border-box; }\n- textarea:focus, select:focus, input[type]:focus {\n- border: 1px solid #2c8898;\n- outline: 0; }\n-\n-input[type=\"checkbox\"]:focus {\n- outline: 1px dotted #2c8898; }\n-\n-label, legend, fieldset {\n- display: block;\n- margin-bottom: .5rem;\n- font-weight: 600; }\n-\n-/* Bolt-specific stuff */\n-\n-.callout {\n- border: 1px solid rgba(0, 0, 0, 0.4);\n- background-color: rgba(0, 0, 0, 0.1);\n- padding: 0 1rem 1rem;\n- margin: 1rem 0;\n-}\n-\n-.meta {\n- color: #888;\n- font-size: 0.9em;\n-}\n-\n-/* Default pagerfanta styles, for pagination */\n-.pagination {\n-}\n-\n-.pagination li {\n- display: inline-block;\n- background: #f4f9fa;\n- border: 1px solid #96c4cc;\n- color: #2c8898;\n- margin-right: .2em;\n- padding: .25em .35em;\n-}\n-\n-.pagination a {\n- text-decoration: none;\n-}\n-\n-.pagination a:hover {\n- background: #c0dbe0;\n- color: #982c61;\n-}\n-\n-.pagination .dots {\n- border-width: 0;\n-}\n-\n-.pagination .current {\n- background: #c0dbe0;\n- font-weight: bold;\n-}\n-\n-.pagination .disabled {\n- border-color: #c0dbe0;\n- color: #abcfd6;\n-}\n-\n-/* Image holder */\n-div.imageholder {\n- border: 1px solid #ccc;\n- padding: 0.5rem;\n- margin: 1rem 0;\n-}\n-\n-div.imageholder small {\n- display: block;\n- text-align: center;\n- font-size: 1.6rem;\n- margin-top: 0.5rem;\n-}\n" }, { "change_type": "MODIFY", "old_path": "public/theme/skeleton/partials/_aside.twig", "new_path": "public/theme/skeleton/partials/_aside.twig", "diff": "{# check if we have a title. If so, we know we have content to display. Otherwise, we will\noutput a default text, telling the user to create the 'blocks' in the backend. #}\n- {% if block.title is defined %}\n+ {% if block %}\n<h5>{{ block.title }}</h5>\n- {{ block.content }}\n+ <p>{{ block.content|default(block|excerpt) }}</p>\n{% set edit_link = block|edit_link %}\n{% set content_link = block.content_link|default(block|link) %}\nThe 'else' in the inner for-loop is only used if there are no 'records',\nso we can use it to print a helpful message.\nLastly, \"path('listing', {'contentTypeSlug': ct.slug})\" will output something like '/pages',\n- effectively creating a working link to that contenttpye's listing page. #}\n+ effectively creating a working link to that contenttype's listing page. #}\n{% for ct in config.get('contenttypes')|filter(ct => not ct.viewless) %}\n" }, { "change_type": "MODIFY", "old_path": "public/theme/skeleton/partials/_header.twig", "new_path": "public/theme/skeleton/partials/_header.twig", "diff": "<p>{{ config.get('general/payoff') }}</p>\n{% endif %}\n- {% include 'helpers/_languageselect.html.twig' with {'type': 'select'} %}\n- <hr>\n+ {{ menu(\n+ name = 'main',\n+ template = 'partials/_sub_menu_header.twig',\n+ withsubmenus = false\n+ ) }}\n</header>\n" }, { "change_type": "MODIFY", "old_path": "public/theme/skeleton/partials/_image.twig", "new_path": "public/theme/skeleton/partials/_image.twig", "diff": "{% if image %}\n<div class=\"imageholder\">\n- {{ popup(image, 1368, 1026) }}\n- <small>{{ image.get('alt') }}</small>\n+ <a href=\"{{ record|image }}\">\n+ <img src=\"{{ thumbnail(record, 1368, 1026) }}\" alt=\"{{ (record|image).alt|default(record|title) }}\">\n+ </a>\n+ {% if image.alt %}\n+ <small>{{ image.alt }}</small>\n+ {% endif %}\n</div>\n{% endif %}\n" }, { "change_type": "MODIFY", "old_path": "public/theme/skeleton/partials/_master.twig", "new_path": "public/theme/skeleton/partials/_master.twig", "diff": "{{- ' | ' ~ config.get('general/payoff') -}}\n{%- endif -%}\n</title>\n- <link rel=\"stylesheet\" href=\"{{ asset('css/normalize.css') }}\">\n- <link rel=\"stylesheet\" href=\"{{ asset('css/sakura.css') }}\">\n+ <link rel=\"stylesheet\" href=\"{{ asset('css/new.css') }}\">\n</head>\n<body>\n{% block body %}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "public/theme/skeleton/partials/_sub_menu_header.twig", "diff": "+{# This file might seem a little complex, because of the high density of tags.\n+ It uses Twig macros and ternary selectors. Read up on them, if required:\n+ macros: http://twig.sensiolabs.org/doc/templates.html#macros\n+ ternary operators: http://twig.sensiolabs.org/doc/templates.html#other-operators\n+#}\n+\n+{# The 'recursive' macro, for inserting one menu item. If it has a submenu, it\n+ invokes itself to insert the items of the submenus. #}\n+{% macro display_menu_item(item, loop, withsubmenus) %}\n+ {% from _self import display_menu_item %}\n+ {% apply spaceless %}\n+ <a href=\"{{ item.uri }}\" title='{{ item.title }}' class='{{ item.class }} {{ loop.first ? ' first' -}}\n+ {{ loop.last ? ' last' -}}\n+ {{ item.current ? ' active' }}'>\n+ {{- item.label -}}\n+ </a>\n+ {% endapply %}\n+{% endmacro %}\n+\n+{# Make the macro available for use #}\n+{% from _self import display_menu_item %}\n+\n+{# The main menu loop: Iterates over the items, calling `display_menu_item` #}\n+<nav>\n+{% for item in menu %}\n+ {% if item.label is defined %}\n+ {{ display_menu_item(item, loop, withsubmenus) }}\n+ {% endif %}\n+ |\n+{% endfor %}\n+{% include 'helpers/_languageselect.html.twig' with {'type': 'select'} %}\n+</nav>\n+\n" }, { "change_type": "MODIFY", "old_path": "public/theme/skeleton/search.twig", "new_path": "public/theme/skeleton/search.twig", "diff": "{% if record|image %}\n<a href=\"{{ record|image }}\">\n- <img src=\"{{ thumbnail(record|image, 400, 260) }}\" alt=\"{{ (record|image).alt|default(record|title) }}\">\n+ <img src=\"{{ thumbnail(record, 400, 260) }}\" alt=\"{{ (record|image).alt|default(record|title) }}\">\n</a>\n{% endif %}\n" } ]
PHP
MIT License
bolt/core
Working on Skeleton Theme (New.css instead of Sakura)
95,144
24.05.2020 12:17:54
-7,200
f02508d5d2bc210cac5a36f9c95ac29881e56107
Updates for skeleton theme
[ { "change_type": "MODIFY", "old_path": "public/theme/skeleton/README.md", "new_path": "public/theme/skeleton/README.md", "diff": "@@ -2,12 +2,12 @@ Bolt Skeleton Theme\n===================\nSkeleton is a minimal theme for Bolt. It has the bare bones functionality of\n-what you commonly expect from a template, without all the bells and whistles.\n+what you'd commonly expect from a template, without all the bells and whistles.\nFeatures:\n- Simple design, function over form.\n- - Uses [Sakura](https://github.com/oxalorg/sakura) as a minimal CSS theme.\n+ - Uses [New.css](https://newcss.net/) as a minimal CSS theme.\n- No Javascript.\nAw yiss.\n" }, { "change_type": "MODIFY", "old_path": "public/theme/skeleton/css/new.css", "new_path": "public/theme/skeleton/css/new.css", "diff": "@@ -434,7 +434,27 @@ img {\n}\n-/* Additions for Bolt */\n+/**\n+ * Additions for Bolt\n+ */\n+h1,\n+h2,\n+h3,\n+h4,\n+h5,\n+h6 {\n+ line-height: 3rem;\n+}\n+\n+h1 a,\n+h2 a,\n+h3 a,\n+h4 a,\n+h5 a,\n+h6 a {\n+ text-decoration: none;\n+}\n+\ninput, select, button {\nfont-size: 1.03rem;\npadding: 0.2rem 1rem 0.2rem 1rem;\n@@ -442,3 +462,86 @@ input, select, button {\nheight: 2.2rem;\n}\n+.callout {\n+ border: 2px dashed rgba(0, 0, 0, 0.2);\n+ background-color: rgba(0, 0, 0, 0.05);\n+ padding: 1rem;\n+ margin: 1rem 0;\n+}\n+\n+/* Image holder */\n+div.imageholder {\n+ border: 1px solid #ccc;\n+ padding: 0.5rem;\n+ margin: 1rem 0;\n+}\n+\n+div.imageholder img {\n+ display: block;\n+}\n+\n+div.imageholder small {\n+ display: block;\n+ text-align: center;\n+ font-size: 0.9rem;\n+}\n+\n+\n+.meta {\n+ color: #888;\n+ font-size: 0.9em;\n+}\n+\n+/* Default pagerfanta styles, for pagination */\n+.pagination {\n+ text-align: center;\n+}\n+\n+.pagination li {\n+ display: inline-block;\n+ background: #f4f9fa;\n+ border: 1px solid #96c4cc;\n+ color: #2c8898;\n+ padding: 0;\n+}\n+\n+.pagination a {\n+ text-decoration: none;\n+ display: inline-block;\n+ padding: .25em .6em;\n+}\n+\n+.pagination a:hover {\n+ background: #c0dbe0;\n+ color: #982c61;\n+}\n+\n+.pagination .dots {\n+ border-width: 0;\n+}\n+\n+.pagination .current {\n+ background: #c0dbe0;\n+ font-weight: bold;\n+}\n+\n+.pagination .disabled {\n+ border-color: #c0dbe0;\n+ color: #abcfd6;\n+}\n+\n+/* reset some styles for `samp` and `code`, because they mess with Symfony's `{{ dump() }}` */\n+samp {\n+ background: inherit;\n+ border: 0;\n+ padding: 0;\n+ font-size: inherit;\n+}\n+\n+code {\n+ /* The main preformatted style. This is changed slightly across different cases. */\n+ background: var(--nc-bg-2);\n+ border: 0;\n+ padding: 3px 3px;\n+ font-size: 0.9rem;\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "symfony.lock", "new_path": "symfony.lock", "diff": "\"behatch/contexts\": {\n\"version\": \"3.2.0\"\n},\n+ \"bobdenotter/configuration-notices\": {\n+ \"version\": \"1.0.2\"\n+ },\n\"bobdenotter/weatherwidget\": {\n\"version\": \"1.1.0\"\n},\n" } ]
PHP
MIT License
bolt/core
Updates for skeleton theme
95,144
24.05.2020 16:57:36
-7,200
4287f61a0da246f004ebd347d179d52074c2360f
Display upload limits and better feedback on failure
[ { "change_type": "MODIFY", "old_path": "assets/js/app/editor/Components/Image.vue", "new_path": "assets/js/app/editor/Components/Image.vue", "diff": "@@ -310,7 +310,8 @@ export default {\nthis.progress = 0;\n})\n.catch(err => {\n- console.warn(err);\n+ bootbox.alert(err.response.data.error.message);\n+ console.warn(err.response.data.error.message);\nthis.progress = 0;\n});\n},\n" }, { "change_type": "MODIFY", "old_path": "assets/scss/init/_base.scss", "new_path": "assets/scss/init/_base.scss", "diff": "@@ -35,11 +35,6 @@ code {\nbackground-color: rgba(0, 0, 0, 0.075);\n}\n-br + small {\n- padding-top: 0.5rem;\n- display: inline-block;\n-}\n-\nsmall {\ncolor: var(--body-dimmed);\n}\n" }, { "change_type": "MODIFY", "old_path": "config/bolt/config.yaml", "new_path": "config/bolt/config.yaml", "diff": "@@ -177,6 +177,10 @@ accept_file_types: [ twig, html, js, css, scss, gif, jpg, jpeg, png, ico, zip, t\naccept_media_types: [ gif, jpg, jpeg, png, svg, pdf, mp3, tiff ]\n+# Set the maximum upload size. Note, this can never exceed the settings for\n+#`post_max_size` and `upload_max_filesize` in `php.ini`.\n+accept_upload_size: 8M\n+\n# If you want to brand the Bolt backend for a client, you can change some key\n# variables here, that determine the name of the backend, and adds a primary\n# support/contact link to the footer. Add a scheme, like `mailto:` or\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/Config.php", "new_path": "src/Configuration/Config.php", "diff": "@@ -222,4 +222,41 @@ class Config\n{\nreturn new Collection($this->get('general/accept_file_types'));\n}\n+\n+ public function getMaxUpload(): int\n+ {\n+ return min(\n+ $this->convertPHPSizeToBytes(ini_get('post_max_size')),\n+ $this->convertPHPSizeToBytes(ini_get('upload_max_filesize')),\n+ $this->convertPHPSizeToBytes($this->get('general/accept_upload_size', '8M'))\n+ );\n+ }\n+\n+ /**\n+ * This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)\n+ */\n+ private function convertPHPSizeToBytes(string $size): int\n+ {\n+ $suffix = mb_strtoupper(mb_substr($size, -1));\n+ if (! in_array($suffix, ['P', 'T', 'G', 'M', 'K'], true)) {\n+ return (int) $size;\n+ }\n+ $value = mb_substr($size, 0, -1);\n+ switch ($suffix) {\n+ case 'P':\n+ $value *= 1024;\n+ case 'T':\n+ $value *= 1024;\n+ case 'G':\n+ $value *= 1024;\n+ case 'M':\n+ $value *= 1024;\n+ case 'K':\n+ $value *= 1024;\n+\n+ break;\n+ }\n+\n+ return (int) $value;\n+ }\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/GeneralParser.php", "new_path": "src/Configuration/Parser/GeneralParser.php", "diff": "@@ -116,6 +116,7 @@ class GeneralParser extends BaseParser\n'only_aliases' => false,\n],\n'accept_file_types' => explode(',', 'twig,html,js,css,scss,gif,jpg,jpeg,png,ico,zip,tgz,txt,md,doc,docx,pdf,epub,xls,xlsx,csv,ppt,pptx,mp3,ogg,wav,m4a,mp4,m4v,ogv,wmv,avi,webm,svg'),\n+ 'accept_upload_size' => '8M',\n'branding' => [\n'name' => 'Bolt',\n'path' => '/bolt',\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/Async/UploadController.php", "new_path": "src/Controller/Backend/Async/UploadController.php", "diff": "@@ -7,6 +7,7 @@ namespace Bolt\\Controller\\Backend\\Async;\nuse Bolt\\Configuration\\Config;\nuse Bolt\\Controller\\CsrfTrait;\nuse Bolt\\Factory\\MediaFactory;\n+use Bolt\\Twig\\TextExtension;\nuse Cocur\\Slugify\\Slugify;\nuse Doctrine\\ORM\\EntityManagerInterface;\nuse Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Security;\n@@ -36,12 +37,16 @@ class UploadController implements AsyncZoneInterface\n/** @var Config */\nprivate $config;\n- public function __construct(MediaFactory $mediaFactory, EntityManagerInterface $em, Config $config, CsrfTokenManagerInterface $csrfTokenManager)\n+ /** @var TextExtension */\n+ private $textExtension;\n+\n+ public function __construct(MediaFactory $mediaFactory, EntityManagerInterface $em, Config $config, CsrfTokenManagerInterface $csrfTokenManager, TextExtension $textExtension)\n{\n$this->mediaFactory = $mediaFactory;\n$this->em = $em;\n$this->config = $config;\n$this->csrfTokenManager = $csrfTokenManager;\n+ $this->textExtension = $textExtension;\n}\n/**\n@@ -70,18 +75,19 @@ class UploadController implements AsyncZoneInterface\n]);\n$acceptedFileTypes = array_merge($this->config->getMediaTypes()->toArray(), $this->config->getFileTypes()->toArray());\n+ $maxSize = $this->config->getMaxUpload();\n$uploadHandler->addRule(\n'extension',\n[\n'allowed' => $acceptedFileTypes,\n],\n- '{label} should be a valid file (' . implode(',', $acceptedFileTypes) . ')',\n+ 'The file for field \\'{label}\\' was <u>not</u> uploaded. It should be a valid file type. Allowed are <code>' . implode('</code>, <code>', $acceptedFileTypes) . '.',\n'Upload file'\n);\n$uploadHandler->addRule(\n'size',\n- ['max' => '20M'],\n- '{label} should have less than {max}',\n+ ['max' => $maxSize],\n+ 'The file for field \\'{label}\\' was <u>not</u> uploaded. The upload can have a maximum filesize of <b>' . $this->textExtension->formatBytes($maxSize) . '</b>.',\n'Upload file'\n);\n$uploadHandler->setSanitizerCallback(function ($name) {\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/TextExtension.php", "new_path": "src/Twig/TextExtension.php", "diff": "@@ -28,6 +28,7 @@ class TextExtension extends AbstractExtension\nnew TwigFilter('slug', [$this, 'slug']),\nnew TwigFilter('ucwords', [$this, 'ucwords']),\nnew TwigFilter('preg_replace', [$this, 'pregReplace']),\n+ new TwigFilter('format_bytes', [$this, 'formatBytes']),\n];\n}\n@@ -65,4 +66,16 @@ class TextExtension extends AbstractExtension\n{\nreturn preg_replace($pattern, $replacement, $str, $limit);\n}\n+\n+ public function formatBytes(int $bytes, int $precision = 2): string\n+ {\n+ $units = ['B', 'KB', 'MB', 'GB', 'TB'];\n+ $bytes = max($bytes, 0);\n+ $pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n+ $pow = min($pow, count($units) - 1);\n+\n+ $bytes /= pow(1024, $pow);\n+\n+ return round($bytes, $precision) . ' ' . $units[$pow];\n+ }\n}\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/file.html.twig", "new_path": "templates/_partials/fields/file.html.twig", "diff": "{% extends '@bolt/_partials/fields/_base.html.twig' %}\n+{% set extensions = field.definition.get('extensions')|default('') %}\n+{% set info %}\n+ {{ 'upload.allow_file_types'|trans }}: <code>{{ extensions|join('</code>, <code>') }}</code><br>\n+ {{ 'upload.max_size'|trans }}: {{ config.maxupload|format_bytes }}\n+{% endset %}\n+\n{% block field %}\n{% set setPath = field.definition.get('upload')|default('') %}\n{% set directory = path('bolt_async_upload', {'location': location|default('files'), 'path': setPath}) %}\n'placeholder_title': 'image.placeholder_title'|trans,\n'button_edit_attributes': 'image.button_edit_attributes'|trans,\n}|json_encode %}\n- {% set extensions = field.definition.get('extensions')|default('') %}\n<editor-file\n:name='{{ name|json_encode }}'\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/filelist.html.twig", "new_path": "templates/_partials/fields/filelist.html.twig", "diff": "{% extends '@bolt/_partials/fields/_base.html.twig' %}\n+{% set extensions = field.definition.get('extensions')|default('') %}\n+{% set info %}\n+ {{ 'upload.allow_file_types'|trans }}: <code>{{ extensions|join('</code>, <code>') }}</code><br>\n+ {{ 'upload.max_size'|trans }}: {{ config.maxupload|format_bytes }}\n+{% endset %}\n+\n{% block field %}\n{% set setPath = field.definition.get('upload')|default('') %}\n{% set directory = path('bolt_async_upload', {'location': location|default('files'), 'path': setPath}) %}\n'add_new_file': 'file.add_new_file'|trans,\n'button_edit_attributes': 'image.button_edit_attributes'|trans,\n}|json_encode %}\n- {% set extensions = field.definition.get('extensions')|default('') %}\n{% set limit = field.definition.get('limit')|default(200) %}\n<editor-filelist\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/image.html.twig", "new_path": "templates/_partials/fields/image.html.twig", "diff": "{% extends '@bolt/_partials/fields/_base.html.twig' %}\n+{% set extensions = field.definition.get('extensions')|default('') %}\n+{% set info %}\n+{{ 'upload.allow_file_types'|trans }}: <code>{{ extensions|join('</code>, <code>') }}</code><br>\n+{{ 'upload.max_size'|trans }}: {{ config.maxupload|format_bytes }}\n+{% endset %}\n+\n{% block field %}\n+\n{% set setPath = field.definition.get('upload')|default('') %}\n{% set directory = path('bolt_async_upload', {'location': location|default('files'), 'path': setPath}) %}\n{% set filelist = path('bolt_async_filelisting', {'location': location|default('files'), 'type': 'images' }) %}\n'placeholder_alt_text': 'image.placeholder_alt_text'|trans,\n'button_edit_attributes': 'image.button_edit_attributes'|trans,\n}|json_encode %}\n- {% set extensions = field.definition.get('extensions')|default('') %}\n<editor-image\n:name='{{ name|json_encode }}'\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/imagelist.html.twig", "new_path": "templates/_partials/fields/imagelist.html.twig", "diff": "{% extends '@bolt/_partials/fields/_base.html.twig' %}\n+{% set extensions = field.definition.get('extensions')|default('') %}\n+{% set info %}\n+ {{ 'upload.allow_file_types'|trans }}: <code>{{ extensions|join('</code>, <code>') }}</code><br>\n+ {{ 'upload.max_size'|trans }}: {{ config.maxupload|format_bytes }}\n+{% endset %}\n+\n{% block field %}\n{% set setPath = field.definition.get('upload')|default('') %}\n'button_move_down': 'image.button_down'|trans,\n'add_new_image': 'image.add_new_image'|trans,\n}|json_encode %}\n- {% set extensions = field.definition.get('extensions')|default('') %}\n{% set limit = field.definition.get('limit')|default(200) %}\n<editor-imagelist\n" }, { "change_type": "MODIFY", "old_path": "templates/finder/_files_actions.html.twig", "new_path": "templates/finder/_files_actions.html.twig", "diff": "<span class=\"dropdown-item-text\">\n<i class=\"fas fa-asterisk fa-w\"></i>\n- {{ 'files_cards.label_filesize'|trans }} {{ file.getSize() }}&nbsp;bytes\n+ {{ 'files_cards.label_filesize'|trans }} {{ file.getSize()|format_bytes(1) }}\n</span>\n<span class=\"dropdown-item-text\">\n" }, { "change_type": "MODIFY", "old_path": "templates/finder/_files_list.html.twig", "new_path": "templates/finder/_files_list.html.twig", "diff": "{%- endif -%}\n</td>\n<td>\n- {{ file.getSize() }}&nbsp;bytes\n+ {{ file.getSize()|format_bytes(1) }}\n{% if dimensions %}<br><small style=\"color: #888;\">{{ dimensions }}</small>{% endif %}\n</td>\n<td>\n" } ]
PHP
MIT License
bolt/core
Display upload limits and better feedback on failure
95,144
24.05.2020 18:00:39
-7,200
3a76b2b9bcfbbedbd9a7bbf0847380ef454b9852
Prepare release 4.0.0 RC 20
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "{\n\"name\": \"bolt\",\n- \"version\": \"4.0.0-rc.17\",\n+ \"version\": \"4.0.0-rc.20\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n}\n},\n\"caniuse-lite\": {\n- \"version\": \"1.0.30001062\",\n- \"resolved\": \"https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001062.tgz\",\n- \"integrity\": \"sha512-ei9ZqeOnN7edDrb24QfJ0OZicpEbsWxv7WusOiQGz/f2SfvBgHHbOEwBJ8HKGVSyx8Z6ndPjxzR6m0NQq+0bfw==\"\n+ \"version\": \"1.0.30001064\",\n+ \"resolved\": \"https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001064.tgz\",\n+ \"integrity\": \"sha512-hdBcQMFvJIrOhkpAZiRXz04Cmetwc9NekeuNl0qZfHOugxOhJKxsjF1RmISMPFjIF4PPx1reliIzbfN42EiQ5A==\"\n},\n\"capture-exit\": {\n\"version\": \"2.0.0\",\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "{\n\"name\": \"bolt\",\n- \"version\": \"4.0.0-rc.17\",\n+ \"version\": \"4.0.0-rc.20\",\n\"homepage\": \"https://boltcms.io\",\n\"author\": \"Bob den Otter <bob@twokings.nl> (https://boltcms.io)\",\n\"license\": \"MIT\",\n\"bootbox\": \"^5.4.0\",\n\"bootstrap\": \"^4.5.0\",\n\"browserslist\": \"^4.12.0\",\n- \"caniuse-lite\": \"^1.0.30001062\",\n+ \"caniuse-lite\": \"^1.0.30001064\",\n\"codemirror\": \"^5.54.0\",\n\"dropzone\": \"^5.7\",\n\"flagpack\": \"^1.0.5\",\n" } ]
PHP
MIT License
bolt/core
Prepare release 4.0.0 RC 20
95,144
24.05.2020 18:14:17
-7,200
2849ec76182e05450581cffae62c9c93aaab28b9
Ninja-fix translations
[ { "change_type": "MODIFY", "old_path": "translations/messages.en.xlf", "new_path": "translations/messages.en.xlf", "diff": "<unit id=\"YZJO3Ul\" name=\"upload.allow_file_types\">\n<segment>\n<source>upload.allow_file_types</source>\n- <target>File types allowed for upload: </target>\n+ <target>File types allowed for upload</target>\n</segment>\n</unit>\n<unit id=\"noOf4ML\" name=\"upload.max_size\">\n<segment>\n<source>upload.max_size</source>\n- <target>Maximum upload size:</target>\n+ <target>Maximum upload size</target>\n</segment>\n</unit>\n</file>\n" } ]
PHP
MIT License
bolt/core
Ninja-fix translations
95,144
26.05.2020 07:43:37
-7,200
6349d962a6d64c16ea45b0f0b65e75f228253488
Add ListServices method to ServiceTrait
[ { "change_type": "MODIFY", "old_path": "src/Extension/ServicesTrait.php", "new_path": "src/Extension/ServicesTrait.php", "diff": "@@ -15,6 +15,7 @@ use Symfony\\Component\\HttpFoundation\\RequestStack;\nuse Symfony\\Component\\HttpFoundation\\Session\\Session;\nuse Symfony\\Component\\Stopwatch\\Stopwatch;\nuse Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface;\n+use Tightenco\\Collect\\Support\\Collection;\nuse Twig\\Environment;\ntrait ServicesTrait\n@@ -76,6 +77,25 @@ trait ServicesTrait\nreturn null;\n}\n+ public function listServices(): Collection\n+ {\n+ $container = $this->getContainer();\n+\n+ $reflectedContainer = new \\ReflectionClass($container);\n+ $reflectionProperty = $reflectedContainer->getProperty('services');\n+ $reflectionProperty->setAccessible(true);\n+ $publicServices = $reflectionProperty->getValue($container);\n+\n+ $reflectionProperty = $reflectedContainer->getProperty('privates');\n+ $reflectionProperty->setAccessible(true);\n+ $privateServices = $reflectionProperty->getValue($container);\n+\n+ $services = array_merge(array_keys($publicServices), array_keys($privateServices));\n+ sort($services);\n+\n+ return collect($services);\n+ }\n+\npublic function getWidgets(): ?Widgets\n{\nreturn $this->getService(\\Bolt\\Widgets::class);\n" } ]
PHP
MIT License
bolt/core
Add ListServices method to ServiceTrait