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,112
11.01.2019 17:23:48
-3,600
afcedc9a0fe83202db5ab92070a0141822a73c9a
further refactor, tests are still failing
[ { "change_type": "MODIFY", "old_path": "src/Content/ContentType.php", "new_path": "src/Content/ContentType.php", "diff": "@@ -19,12 +19,13 @@ final class ContentType extends Collection\nreturn new self($contentTypesConfig->get($name));\n}\n- foreach ($contentTypesConfig as $item => $value) {\n- if ($value['singular_slug'] === $name) {\n- return new self($contentTypesConfig[$item]);\n- }\n- }\n-\n- return null;\n+ return $contentTypesConfig\n+ ->filter(function (array $contentTypeConfig) use ($name): bool {\n+ return $contentTypeConfig['singular_slug'] === $name;\n+ })\n+ ->map(function (array $contentTypeConfig): self {\n+ return new self($contentTypeConfig);\n+ })\n+ ->first();\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/features/dashboard.feature", "new_path": "tests/e2e/features/dashboard.feature", "diff": "Feature: Visiting Dashboard\n- Scenario: Login as Admin to the Dashboard\n- Given I am logged in as \"admin\"\n- When I visit the \"dashboard\" page\n+ Scenario: As an admin I want to see Dashboard page\n+\n+# Given I am logged in as \"admin\"\n+ When I visit the \"login\" page\n+ And I fill the \"login\" form with:\n+ | username | admin |\n+ | password | admin%1 |\n+ And I click the \"login_button\" element\nThen the \"dashboard\" page is displayed\n- And there is element \"header\" with value \"t:Dashboard\"\n\\ No newline at end of file\n+\n+ When I visit the \"dashboard\" page\n+ Then there is element \"header\" with value \"t:Dashboard\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/features/display_record.feature", "new_path": "tests/e2e/features/display_record.feature", "diff": "-Feature: Logging in\n- Scenario: Login as Admin to the Dashboard\n- When I visit the \"login\" page\n- And I fill the \"login\" form with:\n- | username | admin |\n- | password | admin%1 |\n- And I click the \"login_button\" element\n- Then the \"dashboard\" page is displayed\n- And there is element \"profile_text\" with value \"t:Hey, Admin!\"\n\\ No newline at end of file\n+Feature: Display record\n+ Scenario: As a user I want to display a single record\n+ When I visit the \"single_record\" page\n+ Then the \"title\" element is visible\n+ And the \"edit_button\" element is visible\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/features/homepage.feature", "new_path": "tests/e2e/features/homepage.feature", "diff": "-Feature: Logging in\n- Scenario: Login as Admin to the Dashboard\n+Feature: Homepage\n+ Scenario: As a user I want to display Homepage\nWhen I visit the \"homepage\" page\nThen there is element \"title\" with value \"t:Bolt Four Website\"\nThen the \"record_list\" element is visible\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/features/login.feature", "new_path": "tests/e2e/features/login.feature", "diff": "Feature: Logging in\n- Scenario: Login as Admin to the Dashboard\n+ Scenario: As an admin I want to log in to Dashboard\nWhen I visit the \"login\" page\nAnd I fill the \"login\" form with:\n| username | admin |\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/hooks/hook.js", "new_path": "tests/e2e/hooks/hook.js", "diff": "const { defineSupportCode } = require('kakunin');\ndefineSupportCode(({ Before }) => {\n- Before(function () {\n- console.log('If you can see this in console then hook is working properly.');\n- });\n+ // Before(function () {\n+ // console.log('If you can see this in console then hook is working properly.');\n+ // });\n});\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/pages/homepage.js", "new_path": "tests/e2e/pages/homepage.js", "diff": "@@ -6,7 +6,7 @@ class HomepagePage extends BasePage {\nthis.url = '/';\n- this.title = element(by.css('header h2 a'));\n+ this.title = element(by.css('header a'));\nthis.record_list = element(by.css('ul.record_list'));\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/step_definitions/login.js", "new_path": "tests/e2e/step_definitions/login.js", "diff": "-const { defineSupportCode } = require('kakunin');\n-\n-defineSupportCode(function ({ Given }) {\n- Given(/^I am logged in as \"([^\"]*)\"$/, async function (user) {\n- this.currentPage = browser.page.login;\n- this.currentUser = this.userProvider.getUser(user);\n-\n- await this.currentPage.visit();\n- await this.currentPage.waitForVisibilityOf('username');\n- await this.currentPage.fillField('username', this.currentUser.username);\n- await this.currentPage.fillField('password', this.currentUser.password);\n- await this.currentPage.click('login_button');\n- });\n-});\n\\ No newline at end of file\n+// const { defineSupportCode } = require('kakunin');\n+//\n+// defineSupportCode(function ({ Given }) {\n+// Given(/^I am logged in as \"([^\"]*)\"$/, async function (user) {\n+//\n+// this.currentUser = this.userProvider.getUser(user);\n+// this.currentPage = browser.page.login;\n+//\n+// await this.currentPage.visit();\n+// await this.currentPage.waitForVisibilityOf('username');\n+// await this.currentPage.fillField('username', this.currentUser.username);\n+// await this.currentPage.fillField('password', this.currentUser.password);\n+// await this.currentPage.click('login_button');\n+// });\n+// });\n\\ No newline at end of file\n" } ]
PHP
MIT License
bolt/core
further refactor, tests are still failing
95,112
14.01.2019 10:51:48
-3,600
8ab06d73a2d0d72e2a9b88db1176dcbde16c0a23
refactor content magic
[ { "change_type": "MODIFY", "old_path": "public/theme/skeleton/partials/_recordfooter.twig", "new_path": "public/theme/skeleton/partials/_recordfooter.twig", "diff": "{{ include('partials/_sub_taxonomylinks.twig', { record: record }) }}\n</p>\n+ {# @todo refactor to eg. record_prevoius(record, field='id'), same with next #}\n{% set previous = record.previous('id') %}\n{% set next = record.next('id') %}\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Content.php", "new_path": "src/Entity/Content.php", "diff": "@@ -11,8 +11,6 @@ use Bolt\\Configuration\\Config;\nuse Bolt\\Content\\ContentType;\nuse Doctrine\\Common\\Collections\\ArrayCollection;\nuse Doctrine\\Common\\Collections\\Collection;\n-use Doctrine\\Common\\Persistence\\Mapping\\ClassMetadata;\n-use Doctrine\\Common\\Persistence\\ObjectManager;\nuse Doctrine\\Common\\Persistence\\ObjectManagerAware;\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface;\n@@ -37,8 +35,8 @@ use Symfony\\Component\\Serializer\\Annotation\\MaxDepth;\n*/\nclass Content implements ObjectManagerAware\n{\n- use ContentMagicTraits;\n- use ContentLocaliseTraits;\n+ use ContentMagicTrait;\n+ use ContentLocalizeTrait;\npublic const NUM_ITEMS = 8; // @todo This can't be a const\n@@ -114,20 +112,17 @@ class Content implements ObjectManagerAware\n/** @var ContentType */\nprivate $contentTypeDefinition;\n- /** @var UrlGeneratorInterface */\n+ /**\n+ * @var UrlGeneratorInterface\n+ * @todo move out of Entity\n+ */\nprivate $urlGenerator;\n- /** @var Config */\n- private $config;\n-\n/**\n- * Set the \"Magic properties for automagic population in the API.\n+ * @var Config\n+ * @todo move out of Entity\n*/\n- public $magictitle;\n- public $magicexcerpt;\n- public $magicimage;\n- public $magiclink;\n- public $magiceditlink;\n+ private $config;\n/**\n* @ORM\\ManyToMany(targetEntity=\"Bolt\\Entity\\Taxonomy\", mappedBy=\"content\", cascade={\"persist\"})\n@@ -135,9 +130,6 @@ class Content implements ObjectManagerAware\n*/\nprivate $taxonomies;\n- /** @var ObjectManager */\n- private $entityManager;\n-\npublic function __construct()\n{\n$this->createdAt = new \\DateTime();\n@@ -149,11 +141,6 @@ class Content implements ObjectManagerAware\n$this->status = null;\n}\n- public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata): void\n- {\n- $this->entityManager = $objectManager;\n- }\n-\npublic function getId(): ?int\n{\nreturn $this->id;\n@@ -174,11 +161,6 @@ class Content implements ObjectManagerAware\nreturn $this->config;\n}\n- private function getRepository()\n- {\n- return $this->entityManager->getRepository(self::class);\n- }\n-\npublic function setUrlGenerator(UrlGeneratorInterface $urlGenerator): void\n{\n$this->urlGenerator = $urlGenerator;\n" }, { "change_type": "RENAME", "old_path": "src/Entity/ContentLocaliseTraits.php", "new_path": "src/Entity/ContentLocalizeTrait.php", "diff": "@@ -4,7 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Entity;\n-trait ContentLocaliseTraits\n+trait ContentLocalizeTrait\n{\npublic function getLocales()\n{\n" }, { "change_type": "RENAME", "old_path": "src/Entity/ContentMagicTraits.php", "new_path": "src/Entity/ContentMagicTrait.php", "diff": "@@ -5,10 +5,38 @@ declare(strict_types=1);\nnamespace Bolt\\Entity;\nuse Bolt\\Helpers\\Excerpt;\n+use Bolt\\Repository\\ContentRepository;\n+use Doctrine\\Common\\Persistence\\Mapping\\ClassMetadata;\n+use Doctrine\\Common\\Persistence\\ObjectManager;\nuse Twig_Markup;\n-trait ContentMagicTraits\n+trait ContentMagicTrait\n{\n+ /**\n+ * Set the \"Magic properties for automagic population in the API.\n+ */\n+ public $magictitle;\n+ public $magicexcerpt;\n+ public $magicimage;\n+ public $magiclink;\n+ public $magiceditlink;\n+\n+ /** @var ContentRepository */\n+ private $repository;\n+\n+ /**\n+ * Injected with ObjectManagerAware\n+ */\n+ public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata): void\n+ {\n+ $this->repository = $objectManager->getRepository(self::class);\n+ }\n+\n+ private function getRepository(): ContentRepository\n+ {\n+ return $this->repository;\n+ }\n+\npublic function __toString(): string\n{\nreturn 'Content # ' . (string) $this->getId();\n@@ -156,19 +184,21 @@ trait ContentMagicTraits\nreturn new Twig_Markup($excerpt, 'utf-8');\n}\n- public function magicPrevious(string $column = 'id', bool $sameContentType = true): ?Content\n+ public function magicPrevious(string $byColumn = 'id', bool $sameContentType = true): ?Content\n{\n+ $byColumn = filter_var($byColumn, FILTER_SANITIZE_STRING);\n$repository = $this->getRepository();\n$contentType = $sameContentType ? $this->getContenttype() : null;\n- return $repository->findAdjacentBy($column, 'previous', $this->getId(), $contentType);\n+ return $repository->findAdjacentBy($byColumn, 'previous', $this->getId(), $contentType);\n}\n- public function magicNext(string $column = 'id', bool $sameContentType = true): ?Content\n+ public function magicNext(string $byColumn = 'id', bool $sameContentType = true): ?Content\n{\n+ $byColumn = filter_var($byColumn, FILTER_SANITIZE_STRING);\n$repository = $this->getRepository();\n$contentType = $sameContentType ? $this->getContenttype() : null;\n- return $repository->findAdjacentBy($column, 'next', $this->getId(), $contentType);\n+ return $repository->findAdjacentBy($byColumn, 'next', $this->getId(), $contentType);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Repository/ContentRepository.php", "new_path": "src/Repository/ContentRepository.php", "diff": "@@ -84,10 +84,8 @@ class ContentRepository extends ServiceEntityRepository\nreturn $paginator;\n}\n- public function findAdjacentBy(string $column, string $direction, $currentValue, ?string $contentType = null)\n+ public function findAdjacentBy(string $column, string $direction, int $currentValue, ?string $contentType = null)\n{\n- $column = filter_var($column, FILTER_SANITIZE_STRING);\n-\nif ($direction === 'next') {\n$order = 'ASC';\n$whereClause = 'content.' . $column .' > :value';\n" } ]
PHP
MIT License
bolt/core
refactor content magic
95,112
14.01.2019 12:52:46
-3,600
9599d94b23d2a6acd7ef09686cd0165c133ed987
refactor final fixes
[ { "change_type": "MODIFY", "old_path": "src/Controller/BaseController.php", "new_path": "src/Controller/BaseController.php", "diff": "@@ -53,7 +53,7 @@ class BaseController extends AbstractController\n// Resolve string|array of templates into the first one that is found.\nif (is_array($template)) {\n$templates = collect($template)\n- ->map(function ($element): string {\n+ ->map(function ($element): ?string {\nif ($element instanceof TemplateselectField) {\nreturn $element->__toString();\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Frontend/ListingController.php", "new_path": "src/Controller/Frontend/ListingController.php", "diff": "@@ -51,7 +51,7 @@ class ListingController extends BaseController\n/**\n* Route alias for Bolt 3 backwards compatibility\n- * Deprecated since 4.0\n+ * @deprecated since 4.0\n*\n* @Route(\n* \"/{contenttypeslug}\",\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Field.php", "new_path": "src/Entity/Field.php", "diff": "@@ -135,7 +135,7 @@ class Field\nreturn $this->id;\n}\n- public function setDefinitionFromContentDefinition(): void\n+ private function setDefinitionFromContentDefinition(): void\n{\n$contentTypeDefinition = $this->getContent()->getDefinition();\n" }, { "change_type": "MODIFY", "old_path": "templates/content/listing.html.twig", "new_path": "templates/content/listing.html.twig", "diff": "{% extends '@bolt/_base/layout.html.twig' %}\n{% block title %}\n- {% if contenttype %}\n- <i class='fas mr-2 {{contenttype.icon_one}}'></i> <strong>{{ contenttype.name }}</strong>\n+ {% if contentType %}\n+ <i class='fas mr-2 {{contentType.icon_one}}'></i> <strong>{{ contentType.name }}</strong>\n{% else %}\n<strong>{{ 'title.contentlisting'|trans }}</strong>\n{% endif %}\n{% block main %}\n<div>\n- {% include '@bolt/_partials/_content_listing.html.twig' with {'records': records, 'type': 'contenttype' } %}\n+ {% include '@bolt/_partials/_content_listing.html.twig' with {'records': records, 'type': 'contentType' } %}\n</div>\n{% endblock %}\n{% block aside %}\n<listing-select-box\n- plural=\"{{ contenttype.name }}\"\n- singular=\"{{ contenttype.singular_name }}\"\n+ plural=\"{{ contentType.name }}\"\n+ singular=\"{{ contentType.singular_name }}\"\n></listing-select-box>\n<div class=\"card\">\n" } ]
PHP
MIT License
bolt/core
refactor final fixes
95,112
14.01.2019 15:35:34
-3,600
61a5deeb75e412f848ea1a0d84fa19ead40a23db
kakunin upgrade
[ { "change_type": "MODIFY", "old_path": ".gitignore", "new_path": ".gitignore", "diff": "@@ -36,7 +36,6 @@ appveyor.yml\n!/var/cache/.gitkeep\n/var/log/*\n!/var/log/.gitkeep\n-!/var/log/e2e-reports/report/.gitkeep\n/var/data/*\n!/var/data/.gitkeep\n/var/sessions/*\n" }, { "change_type": "MODIFY", "old_path": ".travis.yml", "new_path": ".travis.yml", "diff": "@@ -41,8 +41,6 @@ before_script:\n# test if web server works\n- sleep 3\n- wget \"http://127.0.0.1:8088/bolt/login\"\n- # fix permissions for logs folder\n- - chmod a+rw var/log -R\nscript:\n# run PHP Unit / PHP Spec tests\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/package.json", "new_path": "tests/e2e/package.json", "diff": "},\n\"dependencies\": {\n\"cross-env\": \"^5.2.0\",\n- \"kakunin\": \"^2.3.0\",\n+ \"kakunin\": \"^2.4\",\n\"protractor\": \"^5.4.2\",\n\"webdriver-manager\": \"^12.1.1\"\n}\n" }, { "change_type": "DELETE", "old_path": "var/log/e2e-reports/report/.gitkeep", "new_path": "var/log/e2e-reports/report/.gitkeep", "diff": "" } ]
PHP
MIT License
bolt/core
kakunin upgrade
95,112
14.01.2019 14:39:12
-3,600
9181130f405ff34c1c150f25bd3b7d009a712103
kakunin custom steps
[ { "change_type": "MODIFY", "old_path": "tests/e2e/README.md", "new_path": "tests/e2e/README.md", "diff": "@@ -15,11 +15,24 @@ node ./node_modules/protractor/bin/webdriver-manager update --gecko=false\nUsage\n---\n-Run tests with:\n+Run all tests with:\n```\nnpm run kakunin\n```\n+Running only failed tests is not yet implemented. However you can use tags to run only a few of them!\n+Just add a tag before scenario, like:\n+```\n+Feature: Display record\n+ @wip\n+ Scenario: As a user I want to display a single record\n+```\n+And then run:\n+```\n+npm run kakunin -- --tags @wip\n+```\n+\n+\nWriting tests\n---\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/features/dashboard.feature", "new_path": "tests/e2e/features/dashboard.feature", "diff": "Feature: Visiting Dashboard\nScenario: As an admin I want to see Dashboard page\n-\n-# Given I am logged in as \"admin\"\n- When I visit the \"login\" page\n- And I fill the \"login\" form with:\n- | username | admin |\n- | password | admin%1 |\n- And I click the \"login_button\" element\n- Then the \"dashboard\" page is displayed\n-\n+ Given I am logged in as \"admin\"\nWhen I visit the \"dashboard\" page\n- Then there is element \"header\" with value \"t:Dashboard\"\n\\ No newline at end of file\n+ Then there is element \"header\" with text \"Dashboard\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/features/display_record.feature", "new_path": "tests/e2e/features/display_record.feature", "diff": "Feature: Display record\n+ @wip\nScenario: As a user I want to display a single record\nWhen I visit the \"single_record\" page\n- Then I wait for \"visibilityOf\" of the \"title\" element\n+ Then I wait for \"title\" element to appear\nAnd the \"edit_button\" element is visible\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/features/homepage.feature", "new_path": "tests/e2e/features/homepage.feature", "diff": "Feature: Homepage\nScenario: As a user I want to display Homepage\nWhen I visit the \"homepage\" page\n- Then there is element \"title\" with value \"t:Bolt Four Website\"\n+ Then there is element \"title\" with text \"Bolt Four Website\"\nAnd the \"recent_pages_list\" element is visible\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/features/login.feature", "new_path": "tests/e2e/features/login.feature", "diff": "Feature: Logging in\nScenario: As an admin I want to log in to Dashboard\nWhen I visit the \"login\" page\n- And I fill the \"login\" form with:\n+ And I fill the \"login_form\" form with:\n| username | admin |\n| password | admin%1 |\nAnd I click the \"login_button\" element\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/kakunin.conf.js", "new_path": "tests/e2e/kakunin.conf.js", "diff": "@@ -58,7 +58,7 @@ module.exports = {\n\"admin\": {\n\"accounts\": [\n{\n- \"email\": \"admin\",\n+ \"username\": \"admin\",\n\"password\": \"admin%1\"\n}\n]\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/pages/login.js", "new_path": "tests/e2e/pages/login.js", "diff": "@@ -6,7 +6,7 @@ class LoginPage extends BasePage {\nthis.url = '/bolt/login';\n- this.login = element(by.css('#login-form'));\n+ this.login_form = element(by.css('#login-form'));\nthis.username = element(by.css('#login-form [name=\"username\"]'));\nthis.password = element(by.css('#login-form [name=\"password\"]'));\nthis.login_button = element(by.css('#login-form [type=\"submit\"]'));\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/step_definitions/login.js", "new_path": "tests/e2e/step_definitions/login.js", "diff": "-// const { defineSupportCode } = require('kakunin');\n-//\n-// defineSupportCode(function ({ Given }) {\n-// Given(/^I am logged in as \"([^\"]*)\"$/, async function (user) {\n-//\n-// this.currentUser = this.userProvider.getUser(user);\n-// this.currentPage = browser.page.login;\n-//\n-// await this.currentPage.visit();\n-// await this.currentPage.waitForVisibilityOf('username');\n-// await this.currentPage.fillField('username', this.currentUser.username);\n-// await this.currentPage.fillField('password', this.currentUser.password);\n-// await this.currentPage.click('login_button');\n-// });\n-// });\n\\ No newline at end of file\n+const { defineSupportCode } = require('kakunin');\n+\n+defineSupportCode(function ({ Given }) {\n+ Given(/^I am logged in as \"([^\"]*)\"$/, async function (user) {\n+\n+ this.currentUser = this.userProvider.getUser(user);\n+ this.currentPage = browser.page.login;\n+\n+ await this.currentPage.visit();\n+ await this.currentPage.waitForVisibilityOf('login_form');\n+ await this.currentPage.fillField('username', this.currentUser.username);\n+ await this.currentPage.fillField('password', this.currentUser.password);\n+ await this.currentPage.click('login_button');\n+ });\n+});\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/step_definitions/steps.js", "new_path": "tests/e2e/step_definitions/steps.js", "diff": "const { matchers, variableStore, defineSupportCode } = require('kakunin');\n-defineSupportCode(({ Then }) => {\n- Then(/^my matcher \"([^\"]*)\" matches \"([^\"]*)\"$/, function (matcher, text) {\n- return expect(matchers.match(variableStore.replaceTextVariables(text), matcher)).to.be.true;\n+defineSupportCode(({ When, Then }) => {\n+ When(/^I wait for \"([^\"]*)\" element to appear$/, function (elementName) {\n+ return this.currentPage.waitForVisibilityOf(elementName);\n+ });\n+\n+ Then(/^there is element \"([^\"]*)\" with text \"([^\"]*)\"$/, function (elementName, value) {\n+ const pageElement = this.currentPage[elementName];\n+\n+ return this.currentPage.waitForVisibilityOf(elementName).then(() => {\n+\n+ return matchers.match(pageElement, variableStore.replaceTextVariables('t:' + value)).then(function (matcherResult) {\n+ return expect(matcherResult).to.be.true;\n+ });\n+ });\n});\n});\n\\ No newline at end of file\n" } ]
PHP
MIT License
bolt/core
kakunin custom steps
95,112
14.01.2019 16:39:34
-3,600
2c686145a4ee3f912cfa2a86b05dbc3b9552f27c
edit record test
[ { "change_type": "MODIFY", "old_path": "tests/e2e/features/display_record.feature", "new_path": "tests/e2e/features/display_record.feature", "diff": "Feature: Display record\n- @wip\nScenario: As a user I want to display a single record\nWhen I visit the \"single_record\" page\nThen I wait for \"title\" element to appear\n" }, { "change_type": "ADD", "old_path": null, "new_path": "tests/e2e/features/edit_record.feature", "diff": "+Feature: Edit record\n+ Scenario: As an Admin I want to change title of a record\n+ Given I am logged in as \"admin\"\n+\n+ When I visit the \"dashboard\" page\n+ And I click the \"edit_button\" element\n+ Then the \"edit_record\" page is displayed\n+\n+ When I fill the \"title_field\" field with \"Changed title\"\n+ And I click the \"save_button\" element\n+ Then the \"edit_record\" page is displayed\n+\n+ When I visit the \"dashboard\" page\n+ Then there is element \"record_title\" with text \"Changed title\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/pages/dashboard.js", "new_path": "tests/e2e/pages/dashboard.js", "diff": "@@ -8,6 +8,8 @@ class DashboardPage extends BasePage {\nthis.profile_text = element(by.css('#toolbar .is-profile'));\nthis.header = element(by.css('.admin__header--title strong'));\n+ this.edit_button = element(by.css('#listing .listing__row .listing--actions .link'));\n+ this.record_title = element(by.css('#listing .listing__row .is-details a'));\n}\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "tests/e2e/pages/edit_record.js", "diff": "+const { BasePage } = require('kakunin');\n+\n+class EditRecordPage extends BasePage {\n+ constructor() {\n+ super();\n+\n+ this.url = '/bolt/edit/26';\n+\n+ this.title_field = element(by.id('field-title'));\n+ this.save_button = element(by.css('button[type=\"submit\"]'));\n+ }\n+}\n+\n+module.exports = EditRecordPage;\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/step_definitions/steps.js", "new_path": "tests/e2e/step_definitions/steps.js", "diff": "@@ -7,14 +7,17 @@ defineSupportCode(({ When, Then }) => {\nreturn this.currentPage.waitForVisibilityOf(elementName);\n});\n- Then(/^there is element \"([^\"]*)\" with text \"([^\"]*)\"$/, function (elementName, value) {\n+ Then(/^there is element \"([^\"]*)\" with text \"([^\"]*)\"$/, async function (elementName, value) {\nconst pageElement = this.currentPage[elementName];\n- return this.currentPage.waitForVisibilityOf(elementName).then(() => {\n-\n+ await this.currentPage.waitForVisibilityOf(elementName);\nreturn matchers.match(pageElement, variableStore.replaceTextVariables('t:' + value)).then(function (matcherResult) {\nreturn expect(matcherResult).to.be.true;\n});\n});\n+\n+ When(/^I fill the \"([^\"]*)\" field with \"([^\"]*)\"$/, async function (elementName, value) {\n+ await this.currentPage.waitForVisibilityOf(elementName);\n+ await this.currentPage.fillField(elementName, value);\n});\n});\n\\ No newline at end of file\n" } ]
PHP
MIT License
bolt/core
edit record test
95,144
14.01.2019 17:23:18
-3,600
70f3b0f27e2a5f7cab8c8a5d4f651e667e1e0e28
Delete phpcs.xml.dist, because we have ECS
[ { "change_type": "DELETE", "old_path": "phpcs.xml.dist", "new_path": null, "diff": "-<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-\n-<ruleset xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n- xsi:noNamespaceSchemaLocation=\"vendor/squizlabs/php_codesniffer/phpcs.xsd\">\n-\n- <arg name=\"basepath\" value=\".\"/>\n- <arg name=\"cache\" value=\".phpcs-cache\"/>\n- <arg name=\"colors\"/>\n- <arg name=\"extensions\" value=\"php\"/>\n-\n- <rule ref=\"PSR2\"/>\n-\n- <file>bin/</file>\n- <file>config/</file>\n- <file>public/</file>\n- <file>src/</file>\n- <file>tests/</file>\n-\n-</ruleset>\n" } ]
PHP
MIT License
bolt/core
Delete phpcs.xml.dist, because we have ECS
95,112
15.01.2019 08:32:27
-3,600
5886c8deca8ed97acbae2a39bdfca31c87da4b51
remove edit_record page object
[ { "change_type": "MODIFY", "old_path": "tests/e2e/features/edit_record.feature", "new_path": "tests/e2e/features/edit_record.feature", "diff": "@@ -4,11 +4,10 @@ Feature: Edit record\nWhen I visit the \"pages_overview\" page\nAnd I click the \"edit_button\" element\n- Then the \"edit_record\" page is displayed\n+ Then I wait for \"title_field\" element to appear\nWhen I fill the \"title_field\" field with \"Changed title\"\nAnd I click the \"save_button\" element\n- Then the \"edit_record\" page is displayed\nWhen I visit the \"pages_overview\" page\nThen there is element \"record_title\" with text \"Changed title\"\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "tests/e2e/pages/edit_record.js", "new_path": null, "diff": "-const { BasePage } = require('kakunin');\n-\n-class EditRecordPage extends BasePage {\n- constructor() {\n- super();\n-\n- this.url = '/bolt/edit/5';\n-\n- this.title_field = element(by.id('field-title'));\n- this.save_button = element(by.css('button[type=\"submit\"]'));\n- }\n-}\n-\n-module.exports = EditRecordPage;\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/pages/pages_overview.js", "new_path": "tests/e2e/pages/pages_overview.js", "diff": "@@ -8,6 +8,10 @@ class PagesOvewviewPage extends BasePage {\nthis.edit_button = element(by.css('#listing .listing__row .listing--actions .link'));\nthis.record_title = element(by.css('#listing .listing__row .is-details a'));\n+\n+ // edit record\n+ this.title_field = element(by.id('field-title'));\n+ this.save_button = element(by.css('button[type=\"submit\"]'));\n}\n}\n" } ]
PHP
MIT License
bolt/core
remove edit_record page object
95,112
15.01.2019 14:19:55
-3,600
f5e2718adab88b0002c31a59270e76271f735dad
Slugify as singleton
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/ContentTypesParser.php", "new_path": "src/Configuration/Parser/ContentTypesParser.php", "diff": "@@ -6,8 +6,7 @@ namespace Bolt\\Configuration\\Parser;\nuse Bolt\\Common\\Arr;\nuse Bolt\\Enum\\Statuses;\n-use Bolt\\Helpers\\Str;\n-use Cocur\\Slugify\\Slugify;\n+use Bolt\\Utils\\Str;\nuse Exception;\nuse Tightenco\\Collect\\Support\\Collection;\n@@ -31,7 +30,7 @@ class ContentTypesParser extends BaseParser\n}\n/**\n- * Parse a single Contenttype configuration array.\n+ * Parse a single Content Type configuration array.\n*\n* @param string $key\n* @param array $contentType\n@@ -42,7 +41,7 @@ class ContentTypesParser extends BaseParser\n{\n// If the slug isn't set, and the 'key' isn't numeric, use that as the slug.\nif (! isset($contentType['slug']) && ! is_numeric($key)) {\n- $contentType['slug'] = Slugify::create()->slugify($key);\n+ $contentType['slug'] = Str::slug($key);\n}\n// If neither 'name' nor 'slug' is set, we need to warn the user. Same goes for when\n@@ -63,13 +62,13 @@ class ContentTypesParser extends BaseParser\n}\nif (! isset($contentType['slug'])) {\n- $contentType['slug'] = Slugify::create()->slugify($contentType['name']);\n+ $contentType['slug'] = Str::slug($contentType['name']);\n}\nif (! isset($contentType['name'])) {\n$contentType['name'] = ucwords(preg_replace('/[^a-z0-9]/i', ' ', $contentType['slug']));\n}\nif (! isset($contentType['singular_slug'])) {\n- $contentType['singular_slug'] = Slugify::create()->slugify($contentType['singular_name']);\n+ $contentType['singular_slug'] = Str::slug($contentType['singular_name']);\n}\nif (! isset($contentType['singular_name'])) {\n$contentType['singular_name'] = ucwords(preg_replace('/[^a-z0-9]/i', ' ', $contentType['singular_slug']));\n@@ -100,13 +99,13 @@ class ContentTypesParser extends BaseParser\n$contentType['icon_many'] = str_replace('fa:', 'fa-', $contentType['icon_many']);\n}\n- // Allow explicit setting of a Contenttype's table name suffix. We default\n- // to slug if not present as it has been this way since Bolt v1.2.1\n- if (! isset($contentType['tablename'])) {\n- $contentType['tablename'] = Slugify::create()->slugify($contentType['slug'], '_');\n+ // Allow explicit setting of a Content Type's table name suffix. We default to slug if not present.\n+ if (isset($contentType['tablename'])) {\n+ $contentType['tablename'] = Str::slug($contentType['tablename'], '_');\n} else {\n- $contentType['tablename'] = Slugify::create()->slugify($contentType['tablename'], '_');\n+ $contentType['tablename'] = Str::slug($contentType['slug'], '_');\n}\n+\nif (! isset($contentType['allow_numeric_slugs'])) {\n$contentType['allow_numeric_slugs'] = false;\n}\n@@ -134,8 +133,8 @@ class ContentTypesParser extends BaseParser\n// when adding relations, make sure they're added by their slug. Not their 'name' or 'singular name'.\nif (! empty($contentType['relations']) && is_array($contentType['relations'])) {\nforeach (array_keys($contentType['relations']) as $relkey) {\n- if ($relkey !== Slugify::create()->slugify($relkey)) {\n- $contentType['relations'][Slugify::create()->slugify($relkey)] = $contentType['relations'][$relkey];\n+ if ($relkey !== Str::slug($relkey)) {\n+ $contentType['relations'][Str::slug($relkey)] = $contentType['relations'][$relkey];\nunset($contentType['relations'][$relkey]);\n}\n}\n@@ -151,7 +150,7 @@ class ContentTypesParser extends BaseParser\n}\n/**\n- * Parse a Contenttype's field and determine the grouping.\n+ * Parse a Content Type's field and determine the grouping.\n*\n* @throws Exception\n*/\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/GeneralParser.php", "new_path": "src/Configuration/Parser/GeneralParser.php", "diff": "@@ -5,8 +5,8 @@ declare(strict_types=1);\nnamespace Bolt\\Configuration\\Parser;\nuse Bolt\\Common\\Arr;\n-use Bolt\\Helpers\\Html;\n-use Bolt\\Helpers\\Str;\n+use Bolt\\Utils\\Html;\n+use Bolt\\Utils\\Str;\nuse Tightenco\\Collect\\Support\\Collection;\nuse Webmozart\\PathUtil\\Path;\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/TaxonomyParser.php", "new_path": "src/Configuration/Parser/TaxonomyParser.php", "diff": "@@ -4,8 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Configuration\\Parser;\n-use Bolt\\Helpers\\Str;\n-use Cocur\\Slugify\\Slugify;\n+use Bolt\\Utils\\Str;\nuse Tightenco\\Collect\\Support\\Collection;\nclass TaxonomyParser extends BaseParser\n@@ -17,8 +16,6 @@ class TaxonomyParser extends BaseParser\n{\n$taxonomies = $this->parseConfigYaml('taxonomy.yaml');\n- $slugify = Slugify::create();\n-\nforeach ($taxonomies as $key => $taxonomy) {\nif (! isset($taxonomy['name'])) {\n$taxonomy['name'] = ucwords(str_replace('-', ' ', Str::humanize($taxonomy['slug'])));\n@@ -31,10 +28,10 @@ class TaxonomyParser extends BaseParser\n}\n}\nif (! isset($taxonomy['slug'])) {\n- $taxonomy['slug'] = $slugify->slugify($taxonomy['name']);\n+ $taxonomy['slug'] = Str::slug($taxonomy['name']);\n}\nif (! isset($taxonomy['singular_slug'])) {\n- $taxonomy['singular_slug'] = $slugify->slugify($taxonomy['singular_name']);\n+ $taxonomy['singular_slug'] = Str::slug($taxonomy['singular_name']);\n}\nif (! isset($taxonomy['has_sortorder'])) {\n$taxonomy['has_sortorder'] = false;\n@@ -54,7 +51,7 @@ class TaxonomyParser extends BaseParser\n$optionKey = $optionValue;\n$optionValue = Str::humanize($optionValue);\n}\n- $optionKey = $slugify->slugify($optionKey);\n+ $optionKey = Str::slug($optionKey);\n$options[$optionKey] = $optionValue;\n}\n$taxonomy['options'] = $options;\n" }, { "change_type": "MODIFY", "old_path": "src/DataFixtures/TaxonomyFixtures.php", "new_path": "src/DataFixtures/TaxonomyFixtures.php", "diff": "@@ -4,10 +4,9 @@ declare(strict_types=1);\nnamespace Bolt\\DataFixtures;\n-use Bolt\\Common\\Str;\nuse Bolt\\Configuration\\Config;\nuse Bolt\\Entity\\Taxonomy;\n-use Cocur\\Slugify\\Slugify;\n+use Bolt\\Utils\\Str;\nuse Doctrine\\Bundle\\FixturesBundle\\Fixture;\nuse Doctrine\\Common\\DataFixtures\\DependentFixtureInterface;\nuse Doctrine\\Common\\Persistence\\ObjectManager;\n@@ -37,7 +36,6 @@ class TaxonomyFixtures extends Fixture implements DependentFixtureInterface\nprivate function loadTaxonomies(ObjectManager $manager): void\n{\n- $slugify = Slugify::create();\n$order = 1;\nforeach ($this->config as $taxonomyDefinition) {\n@@ -55,12 +53,12 @@ class TaxonomyFixtures extends Fixture implements DependentFixtureInterface\n}\n$taxonomy->setType($taxonomyDefinition['slug'])\n- ->setSlug($slugify->slugify($key))\n+ ->setSlug(Str::slug($key))\n->setName(Str::humanize($value))\n->setSortorder($taxonomyDefinition['has_sortorder'] ? $order++ : 0);\n$manager->persist($taxonomy);\n- $reference = 'taxonomy_' . $taxonomyDefinition['slug'] . '_' . $slugify->slugify($key);\n+ $reference = 'taxonomy_' . $taxonomyDefinition['slug'] . '_' . Str::slug($key);\n$this->addReference($reference, $taxonomy);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Field/SlugField.php", "new_path": "src/Entity/Field/SlugField.php", "diff": "@@ -5,7 +5,7 @@ declare(strict_types=1);\nnamespace Bolt\\Entity\\Field;\nuse Bolt\\Entity\\Field;\n-use Cocur\\Slugify\\Slugify;\n+use Bolt\\Utils\\Str;\nuse Doctrine\\ORM\\Mapping as ORM;\n/**\n@@ -15,7 +15,7 @@ class SlugField extends Field\n{\npublic function setValue(array $value): parent\n{\n- $value = Slugify::create()->slugify(reset($value));\n+ $value = Str::slug(reset($value));\n$this->value = [$value];\nreturn $this;\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Taxonomy.php", "new_path": "src/Entity/Taxonomy.php", "diff": "@@ -5,7 +5,7 @@ declare(strict_types=1);\nnamespace Bolt\\Entity;\nuse ApiPlatform\\Core\\Annotation\\ApiResource;\n-use Bolt\\Helpers\\Str;\n+use Bolt\\Utils\\Str;\nuse Doctrine\\Common\\Collections\\ArrayCollection;\nuse Doctrine\\Common\\Collections\\Collection;\nuse Doctrine\\ORM\\Mapping as ORM;\n" }, { "change_type": "MODIFY", "old_path": "src/Helpers/Excerpt.php", "new_path": "src/Helpers/Excerpt.php", "diff": "@@ -5,6 +5,8 @@ declare(strict_types=1);\nnamespace Bolt\\Helpers;\nuse Bolt\\Entity\\Content;\n+use Bolt\\Entity\\Field\\Excerptable;\n+use Bolt\\Utils\\Html;\nclass Excerpt\n{\n@@ -44,7 +46,7 @@ class Excerpt\n$skipFields = $this->content->magicTitleFields();\nforeach ($this->content->getFields() as $field) {\n- if (! in_array($field->getName(), $skipFields, true) && $field->isExcerptable()) {\n+ if (in_array($field->getName(), $skipFields, true) === false && $field instanceof Excerptable) {\n$excerpt .= $field->__toString();\n}\n}\n" }, { "change_type": "DELETE", "old_path": "src/Helpers/Str.php", "new_path": null, "diff": "-<?php\n-\n-declare(strict_types=1);\n-\n-namespace Bolt\\Helpers;\n-\n-use Cocur\\Slugify\\Slugify;\n-\n-class Str extends \\Bolt\\Common\\Str\n-{\n- /**\n- * Returns a \"safe\" version of the given string - basically only US-ASCII and\n- * numbers. Needed because filenames and titles and such, can't use all characters.\n- */\n- public static function makeSafe(string $str, bool $strict = false, string $extrachars = ''): string\n- {\n- $str = str_replace('&amp;', '', $str);\n-\n- $delim = '/';\n- if ($extrachars !== '') {\n- $extrachars = preg_quote($extrachars, $delim);\n- }\n- if ($strict) {\n- $slugify = Slugify::create([\n- 'regexp' => '/[^a-z0-9_' . $extrachars . ' -]+/',\n- ]);\n- $str = $slugify->slugify($str, '');\n- $str = str_replace(' ', '-', $str);\n- } else {\n- // Allow Uppercase and don't convert spaces to dashes\n- $slugify = Slugify::create([\n- 'regexp' => '/[^a-zA-Z0-9_.,' . $extrachars . ' -]+/',\n- 'lowercase' => false,\n- ]);\n- $str = $slugify->slugify($str, '');\n- }\n-\n- return $str;\n- }\n-\n- public static function slug(string $str): string\n- {\n- $slugify = Slugify::create();\n-\n- return $slugify->slugify($str);\n- }\n-\n- /**\n- * Add 'soft hyphens' &shy; to a string, so that it won't break layout in HTML when\n- * using strings without spaces or dashes. Only breaks in long (> 19 chars) words.\n- */\n- public static function shyphenate(string $str): string\n- {\n- $res = preg_match_all('/([a-z0-9]{19,})/i', $str, $matches);\n-\n- if ($res) {\n- foreach ($matches[1] as $match) {\n- $str = str_replace($match, wordwrap($match, 10, '&shy;', true), $str);\n- }\n- }\n-\n- return $str;\n- }\n-}\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/TextExtension.php", "new_path": "src/Twig/TextExtension.php", "diff": "@@ -4,7 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Twig;\n-use Bolt\\Helpers\\Str;\n+use Bolt\\Utils\\Str;\nuse Twig\\Extension\\AbstractExtension;\nuse Twig\\TwigFilter;\n" }, { "change_type": "RENAME", "old_path": "src/Helpers/Html.php", "new_path": "src/Utils/Html.php", "diff": "declare(strict_types=1);\n-namespace Bolt\\Helpers;\n+namespace Bolt\\Utils;\nclass Html\n{\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Utils/Str.php", "diff": "+<?php\n+\n+declare(strict_types=1);\n+\n+namespace Bolt\\Utils;\n+\n+use Cocur\\Slugify\\Slugify;\n+\n+class Str extends \\Bolt\\Common\\Str\n+{\n+ /**\n+ * We use Slugify as a Singleton because Slugify::create() is quite heavy\n+ *\n+ * @var Slugify\n+ */\n+ private static $slugifyInstance = null;\n+\n+ /**\n+ * @var Slugify[]\n+ */\n+ private static $slugifySafeInstances = [];\n+\n+ /**\n+ * Returns a \"safe\" version of the given string - basically only US-ASCII and\n+ * numbers. Needed because filenames and titles and such, can't use all characters.\n+ */\n+ public static function makeSafe(string $str, bool $strict = false, string $extrachars = ''): string\n+ {\n+ $str = str_replace('&amp;', '', $str);\n+\n+ $slugify = self::getSafeSlugify($strict, $extrachars);\n+ $str = $slugify->slugify($str, '');\n+\n+ if ($strict) {\n+ $str = str_replace(' ', '-', $str);\n+ }\n+\n+ return $str;\n+ }\n+\n+ public static function slug(string $str, $options = null): string\n+ {\n+ return self::getSlugify()->slugify($str, $options);\n+ }\n+\n+ /**\n+ * Add 'soft hyphens' &shy; to a string, so that it won't break layout in HTML when\n+ * using strings without spaces or dashes. Only breaks in long (> 19 chars) words.\n+ */\n+ public static function shyphenate(string $str): string\n+ {\n+ $res = preg_match_all('/([a-z0-9]{19,})/i', $str, $matches);\n+\n+ if ($res) {\n+ foreach ($matches[1] as $match) {\n+ $str = str_replace($match, wordwrap($match, 10, '&shy;', true), $str);\n+ }\n+ }\n+\n+ return $str;\n+ }\n+\n+ private static function getSlugify(): Slugify\n+ {\n+ if (self::$slugifyInstance === null) {\n+ self::$slugifyInstance = Slugify::create();\n+ }\n+ return self::$slugifyInstance;\n+ }\n+\n+ private static function getSafeSlugify(bool $strict = false, string $extrachars = ''): Slugify\n+ {\n+ $key = $strict ? 'strict_' : '' . $extrachars;\n+\n+ if (empty(self::$slugifySafeInstances[$key]) === true) {\n+ $delim = '/';\n+ if ($extrachars !== '') {\n+ $extrachars = preg_quote($extrachars, $delim);\n+ }\n+ if ($strict) {\n+ $slugify = Slugify::create([\n+ 'regexp' => '/[^a-z0-9_' . $extrachars . ' -]+/',\n+ ]);\n+ } else {\n+ // Allow Uppercase and don't convert spaces to dashes\n+ $slugify = Slugify::create([\n+ 'regexp' => '/[^a-zA-Z0-9_.,' . $extrachars . ' -]+/',\n+ 'lowercase' => false,\n+ ]);\n+ }\n+\n+ self::$slugifySafeInstances[$key] = $slugify;\n+ }\n+\n+ return self::$slugifySafeInstances[$key];\n+ }\n+}\n" }, { "change_type": "RENAME", "old_path": "tests/php/Helpers/StrTest.php", "new_path": "tests/php/Utils/StrTest.php", "diff": "declare(strict_types=1);\n-namespace Bolt\\Tests\\Helpers;\n-\n-use Bolt\\Helpers\\Str;\n+namespace Bolt\\Tests\\Utils;\nclass StrTest extends \\PHPUnit\\Framework\\TestCase\n{\npublic function testSlug()\n{\n- $slug = Str::slug('test 1');\n+ $slug = \\Bolt\\Utils\\Str::slug('test 1');\n$this->assertEquals('test-1', $slug);\n}\n}\n\\ No newline at end of file\n" } ]
PHP
MIT License
bolt/core
Slugify as singleton
95,144
14.01.2019 17:01:10
-3,600
0a6f871d5a442432408db9bc6373681fffdae847
Minor fixes and cleanup for taxonomies
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/TaxonomyParser.php", "new_path": "src/Configuration/Parser/TaxonomyParser.php", "diff": "@@ -40,7 +40,14 @@ class TaxonomyParser extends BaseParser\n$taxonomy['allow_spaces'] = false;\n}\nif (! isset($taxonomy['allow_empty'])) {\n- $taxonomy['allow_empty'] = false;\n+ $taxonomy['allow_empty'] = true;\n+ }\n+ if ($taxonomy['behaves_like'] === 'grouping') {\n+ $taxonomy['multiple'] = false;\n+ } elseif ($taxonomy['behaves_like'] === 'tags' || (isset($taxonomy['multiple']) && $taxonomy['multiple'])) {\n+ $taxonomy['multiple'] = true;\n+ } else {\n+ $taxonomy['multiple'] = false;\n}\n// Make sure the options are $key => $value pairs, and not have implied integers for keys.\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Taxonomy.php", "new_path": "src/Entity/Taxonomy.php", "diff": "@@ -75,7 +75,7 @@ class Taxonomy\n$taxonomy->setType($type);\n$taxonomy->setSlug($slug);\n- $taxonomy->setName($name ?: Str::humanize($slug));\n+ $taxonomy->setName($name ?: $slug);\nreturn $taxonomy;\n}\n@@ -130,7 +130,7 @@ class Taxonomy\npublic function setSlug(string $slug): self\n{\n- $this->slug = $slug;\n+ $this->slug = Str::slug($slug);\nreturn $this;\n}\n@@ -142,6 +142,10 @@ class Taxonomy\npublic function setName(string $name): self\n{\n+ if ($name === mb_strtolower($name)) {\n+ $name = Str::humanize($name);\n+ }\n+\n$this->name = $name;\nreturn $this;\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentHelperExtension.php", "new_path": "src/Twig/ContentHelperExtension.php", "diff": "@@ -156,14 +156,6 @@ class ContentHelperExtension extends AbstractExtension\n$options[] = [\n'key' => $key,\n'value' => $value,\n- 'selected' => false, // TODO: determine if we need this.\n- ];\n- }\n-\n- if ($taxonomy['allow_empty']) {\n- $options[] = [\n- 'key' => '',\n- 'value' => '(none selected)',\n];\n}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_taxonomies.html.twig", "new_path": "templates/content/_taxonomies.html.twig", "diff": "{% set options = taxonomyoptions(definition) %}\n{% set value = taxonomyvalues(record.taxonomies, definition) %}\n- {% if definition.behaves_like == 'grouping' %}\n- {% set multiple = 'false' %}\n- {% set taggable = 'false' %}\n- {% elseif definition.behaves_like == 'categories' %}\n- {% set multiple = definition.multiple ? 'true' : 'false' %}\n- {% set taggable = 'false' %}\n- {% else %} {# so, 'tags' #}\n- {% set multiple = 'true' %}\n- {% set taggable = 'true' %}\n- {% endif %}\n-\n<div class=\"form-group editor--group is-normal\">\n<label for=\"field-title\">\n{{ definition.name }}:\n:name=\"'taxonomy[{{ definition.slug }}]'\"\n:id=\"'taxonomy-{{ definition.slug }}'\"\n:options=\"{{ options|json_encode() }}\"\n- :multiple=\"{{ multiple }}\"\n- :taggable=\"{{ taggable }}\"\n+ :multiple=\"{{ definition.multiple }}\"\n+ :taggable=\"{{ (definition.behaves_like == 'tags') }}\"\n></editor-select>\n- (Current saved value: <code>{{ value|json_encode() }}</code> )\n+ {# (Current saved value: <code>{{ value|json_encode() }}</code> ) #}\n</div>\n</div>\n" } ]
PHP
MIT License
bolt/core
Minor fixes and cleanup for taxonomies
95,144
14.01.2019 18:07:24
-3,600
40e313625ad95baceb96526561cec158aff9e613
Explicitly type-cast bools in Twig
[ { "change_type": "MODIFY", "old_path": "templates/content/_taxonomies.html.twig", "new_path": "templates/content/_taxonomies.html.twig", "diff": ":name=\"'taxonomy[{{ definition.slug }}]'\"\n:id=\"'taxonomy-{{ definition.slug }}'\"\n:options=\"{{ options|json_encode() }}\"\n- :multiple=\"{{ definition.multiple }}\"\n- :taggable=\"{{ (definition.behaves_like == 'tags') }}\"\n+ :multiple=\"{{ definition.multiple ? 'true' : 'false' }}\"\n+ :taggable=\"{{ (definition.behaves_like == 'tags') ? 'true' : 'false' }}\"\n></editor-select>\n{# (Current saved value: <code>{{ value|json_encode() }}</code> ) #}\n" } ]
PHP
MIT License
bolt/core
Explicitly type-cast bools in Twig
95,144
16.01.2019 07:28:51
-3,600
95afd2b06a1f768d99dbe8016319fadd1fc37fc0
Don't "Humanize" name attribute.
[ { "change_type": "MODIFY", "old_path": "src/Entity/Taxonomy.php", "new_path": "src/Entity/Taxonomy.php", "diff": "@@ -143,10 +143,6 @@ class Taxonomy\npublic function setName(string $name): self\n{\n- if ($name === mb_strtolower($name)) {\n- $name = Str::humanize($name);\n- }\n-\n$this->name = $name;\nreturn $this;\n" } ]
PHP
MIT License
bolt/core
Don't "Humanize" name attribute.
95,144
16.01.2019 10:35:01
-3,600
e3064592364e040168b741a321a462a42db4447f
Requested change to Taxonomy.php
[ { "change_type": "MODIFY", "old_path": "src/Entity/Taxonomy.php", "new_path": "src/Entity/Taxonomy.php", "diff": "@@ -69,14 +69,14 @@ class Taxonomy\n/**\n* @return Taxonomy\n*/\n- public static function factory(string $type, string $slug, ?string $name = null, ?int $sortorder = null): self\n+ public static function factory(string $type, string $slug, ?string $name = null, int $sortorder = 0): self\n{\n$taxonomy = new self();\n$taxonomy->setType($type);\n$taxonomy->setSlug($slug);\n$taxonomy->setName($name ?: $slug);\n- $taxonomy->setSortorder($sortorder ?: 0);\n+ $taxonomy->setSortorder($sortorder);\nreturn $taxonomy;\n}\n" } ]
PHP
MIT License
bolt/core
Requested change to Taxonomy.php
95,144
16.01.2019 11:33:38
-3,600
14c604a92f4916f385e20aac1d14b68e5accbfd7
Add to TaxonomyRepositoryTest
[ { "change_type": "MODIFY", "old_path": "tests/php/Repository/TaxonomyRepositoryTest.php", "new_path": "tests/php/Repository/TaxonomyRepositoryTest.php", "diff": "@@ -7,6 +7,11 @@ namespace Bolt\\Tests\\Repository;\nuse Bolt\\Entity\\Taxonomy;\nuse Symfony\\Bundle\\FrameworkBundle\\Test\\KernelTestCase;\n+/**\n+ * Class TaxonomyRepositoryTest\n+ *\n+ * @todo Add represenative tests here, when methods are implemented in TaxonomyRepository\n+ */\nclass TaxonomyRepositoryTest extends KernelTestCase\n{\n/** @var \\Doctrine\\ORM\\EntityManager */\n" }, { "change_type": "MODIFY", "old_path": "tests/spec/Bolt/Security/LoginFormAuthenticatorSpec.php", "new_path": "tests/spec/Bolt/Security/LoginFormAuthenticatorSpec.php", "diff": "<?php\n+declare(strict_types=1);\n+\nnamespace spec\\Bolt\\Security;\nuse Bolt\\Entity\\User;\n@@ -20,28 +22,31 @@ use Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface;\n*/\nclass LoginFormAuthenticatorSpec extends ObjectBehavior\n{\n- const TEST_TOKEN = ['csrf_token' => null, 'username' => null];\n+ public const TEST_TOKEN = [\n+ 'csrf_token' => null,\n+ 'username' => null,\n+ ];\n- function let(UserRepository $userRepository, RouterInterface $router, CsrfTokenManagerInterface $csrfTokenManager, UserPasswordEncoderInterface $userPasswordEncoder)\n+ public function let(UserRepository $userRepository, RouterInterface $router, CsrfTokenManagerInterface $csrfTokenManager, UserPasswordEncoderInterface $userPasswordEncoder): void\n{\n$this->beConstructedWith($userRepository, $router, $csrfTokenManager, $userPasswordEncoder);\n}\n- function it_gets_login_url(RouterInterface $router, Request $request)\n+ public function it_gets_login_url(RouterInterface $router, Request $request): void\n{\n$router->generate(Argument::type('string'))->shouldBeCalledOnce()->willReturn('test_route');\n$res = $this->start($request);\n$res->getTargetUrl()->shouldBe('test_route');\n}\n- function it_gets_user(CsrfTokenManagerInterface $csrfTokenManager, UserProviderInterface $userProvider, UserRepository $userRepository, User $user)\n+ public function it_gets_user(CsrfTokenManagerInterface $csrfTokenManager, UserProviderInterface $userProvider, UserRepository $userRepository, User $user): void\n{\n$userRepository->findOneBy(['username' => null])->shouldBeCalledOnce()->wilLReturn($user);\n$csrfTokenManager->isTokenValid(Argument::type(CsrfToken::class))->willReturn(true);\n$this->getUser(self::TEST_TOKEN, $userProvider)->shouldBeAnInstanceOf(User::class);\n}\n- function it_throws_while_getting_user(CsrfTokenManagerInterface $csrfTokenManager, UserProviderInterface $userProvider)\n+ public function it_throws_while_getting_user(CsrfTokenManagerInterface $csrfTokenManager, UserProviderInterface $userProvider): void\n{\n$csrfTokenManager->isTokenValid(Argument::any())->willReturn(false);\n@@ -49,7 +54,7 @@ class LoginFormAuthenticatorSpec extends ObjectBehavior\n'getUser',\n[\nself::TEST_TOKEN,\n- $userProvider\n+ $userProvider,\n]\n);\n}\n" } ]
PHP
MIT License
bolt/core
Add @todo to TaxonomyRepositoryTest
95,112
16.01.2019 13:50:11
-3,600
84dfebee1d3fef126899d8c59a525823e97cfa8b
fix composer for travis
[ { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"symplify/easy-coding-standard\": \"^5.2\"\n},\n\"repositories\": [\n- { \"type\": \"vcs\", \"url\": \"https://github.com/jarjak/php-matcher\" }\n+ { \"type\": \"vcs\", \"url\": \"https://github.com/jarjak/php-matcher\", \"no-api\": true }\n],\n\"minimum-stability\": \"stable\",\n\"prefer-stable\": true,\n" } ]
PHP
MIT License
bolt/core
fix composer for travis
95,112
16.01.2019 15:30:04
-3,600
65169ae6670be5bf7f4dee749f9afbfac6284d66
magic content fixes
[ { "change_type": "MODIFY", "old_path": "public/theme/skeleton/index.twig", "new_path": "public/theme/skeleton/index.twig", "diff": "{% if record is defined %}\n- <h1>{{ record.title }}</h1>\n+ <h1><a href=\"{{ record.link }}\">{{ record.title }}</a></h1>\n{# Remove this block if you don't need it anymore. #}\n{{ include('partials/_fresh_install.twig') }}\n" }, { "change_type": "MODIFY", "old_path": "public/theme/skeleton/partials/_sub_fields.twig", "new_path": "public/theme/skeleton/partials/_sub_fields.twig", "diff": "{% endfor %}\n{# We do the same for the templatefields, if set and not empty. #}\n- {% set templatefields = record.values.templatefields.values|default() %}\n+ {% set templatefields = record.getValue('templateFields') %}\n{% if templatefields is not empty %}\n{# Note: This needs to be expanded upon!! For better detection the 'virtual'\n" }, { "change_type": "MODIFY", "old_path": "src/Content/MenuBuilder.php", "new_path": "src/Content/MenuBuilder.php", "diff": "@@ -100,7 +100,7 @@ class MenuBuilder\n'icon' => 'fa-sliders-h',\n]]);\n- $menu['Configuration']->addChild('Users &amp; Permissions', [\n+ $menu->getChild('Configuration')->addChild('Users &amp; Permissions', [\n'uri' => $this->urlGenerator->generate('bolt_users'),\n'extras' => [\n'name' => $t->trans('caption.users_permissions'),\n@@ -108,7 +108,7 @@ class MenuBuilder\n],\n]);\n- $menu['Configuration']->addChild('Main configuration', [\n+ $menu->getChild('Configuration')->addChild('Main configuration', [\n'uri' => $this->urlGenerator->generate('bolt_file_edit', [\n'area' => 'config',\n'file' => '/bolt/config.yaml',\n@@ -119,7 +119,7 @@ class MenuBuilder\n],\n]);\n- $menu['Configuration']->addChild('ContentTypes', [\n+ $menu->getChild('Configuration')->addChild('ContentTypes', [\n'uri' => $this->urlGenerator->generate('bolt_file_edit', [\n'area' => 'config',\n'file' => '/bolt/contenttypes.yaml',\n@@ -130,7 +130,7 @@ class MenuBuilder\n],\n]);\n- $menu['Configuration']->addChild('Taxonomies', [\n+ $menu->getChild('Configuration')->addChild('Taxonomies', [\n'uri' => $this->urlGenerator->generate('bolt_file_edit', [\n'area' => 'config',\n'file' => '/bolt/taxonomy.yaml',\n@@ -141,7 +141,7 @@ class MenuBuilder\n],\n]);\n- $menu['Configuration']->addChild('Menu set up', [\n+ $menu->getChild('Configuration')->addChild('Menu set up', [\n'uri' => $this->urlGenerator->generate('bolt_file_edit', [\n'area' => 'config',\n'file' => '/bolt/menu.yaml',\n@@ -153,7 +153,7 @@ class MenuBuilder\n],\n]);\n- $menu['Configuration']->addChild('Routing set up', [\n+ $menu->getChild('Configuration')->addChild('Routing set up', [\n'uri' => $this->urlGenerator->generate('bolt_file_edit', [\n'area' => 'config',\n'file' => '/routes.yaml',\n@@ -164,7 +164,7 @@ class MenuBuilder\n],\n]);\n- $menu['Configuration']->addChild('All configuration files', [\n+ $menu->getChild('Configuration')->addChild('All configuration files', [\n'uri' => $this->urlGenerator->generate('bolt_filemanager', ['area' => 'config']),\n'extras' => [\n'name' => $t->trans('caption.all_configuration_files'),\n@@ -179,7 +179,7 @@ class MenuBuilder\n'icon' => 'fa-tools',\n]]);\n- $menu['Maintenance']->addChild('Bolt API', [\n+ $menu->getChild('Maintenance')->addChild('Bolt API', [\n'uri' => $this->urlGenerator->generate('api_entrypoint'),\n'extras' => [\n'name' => $t->trans('caption.api'),\n@@ -187,7 +187,7 @@ class MenuBuilder\n],\n]);\n- $menu['Maintenance']->addChild('Check database', [\n+ $menu->getChild('Maintenance')->addChild('Check database', [\n'uri' => '',\n'extras' => [\n'name' => $t->trans('caption.check_database'),\n@@ -195,7 +195,7 @@ class MenuBuilder\n],\n]);\n- $menu['Maintenance']->addChild('Fixtures', [\n+ $menu->getChild('Maintenance')->addChild('Fixtures', [\n'uri' => '',\n'extras' => [\n'name' => $t->trans('caption.fixtures_dummy_content'),\n@@ -203,7 +203,7 @@ class MenuBuilder\n],\n]);\n- $menu['Maintenance']->addChild('Clear the cache', [\n+ $menu->getChild('Maintenance')->addChild('Clear the cache', [\n'uri' => $this->urlGenerator->generate('bolt_clear_cache'),\n'extras' => [\n'name' => $t->trans('caption.clear_cache'),\n@@ -211,7 +211,7 @@ class MenuBuilder\n],\n]);\n- $menu['Maintenance']->addChild('Installation checks', [\n+ $menu->getChild('Maintenance')->addChild('Installation checks', [\n'uri' => '',\n'extras' => [\n'name' => $t->trans('caption.installation_checks'),\n@@ -219,7 +219,7 @@ class MenuBuilder\n],\n]);\n- $menu['Maintenance']->addChild('Translations: Messages', [\n+ $menu->getChild('Maintenance')->addChild('Translations: Messages', [\n'uri' => $this->urlGenerator->generate('translation_index'),\n'extras' => [\n'name' => $t->trans('caption.translations'),\n@@ -227,7 +227,7 @@ class MenuBuilder\n],\n]);\n- $menu['Maintenance']->addChild('Extensions', [\n+ $menu->getChild('Maintenance')->addChild('Extensions', [\n'uri' => '',\n'extras' => [\n'name' => $t->trans('caption.extensions'),\n@@ -242,7 +242,7 @@ class MenuBuilder\n'icon' => 'fa-folder-open',\n]]);\n- $menu['File Management']->addChild('Uploaded files', [\n+ $menu->getChild('File Management')->addChild('Uploaded files', [\n'uri' => $this->urlGenerator->generate('bolt_filemanager', ['area' => 'files']),\n'extras' => [\n'name' => $t->trans('caption.uploaded_files'),\n@@ -250,7 +250,7 @@ class MenuBuilder\n],\n]);\n- $menu['File Management']->addChild('View/edit Templates', [\n+ $menu->getChild('File Management')->addChild('View/edit Templates', [\n'uri' => $this->urlGenerator->generate('bolt_filemanager', ['area' => 'themes']),\n'extras' => [\n'name' => $t->trans('caption.view_edit_templates'),\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Content.php", "new_path": "src/Entity/Content.php", "diff": "@@ -312,6 +312,12 @@ class Content implements ObjectManagerAware\nreturn $fieldValues;\n}\n+ public function getValue(string $fieldName): ?array\n+ {\n+ $field = $this->getField($fieldName);\n+ return $field ? $field->getValue() : null;\n+ }\n+\n/**\n* @Groups(\"get_content\")\n*/\n@@ -408,4 +414,10 @@ class Content implements ObjectManagerAware\nreturn $this;\n}\n+\n+ public function related(): array\n+ {\n+ // @todo See Github issue https://github.com/bolt/four/issues/163\n+ return [];\n+ }\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/ContentMagicTrait.php", "new_path": "src/Entity/ContentMagicTrait.php", "diff": "@@ -101,11 +101,13 @@ trait ContentMagicTrait\nprivate function magic(string $name, array $arguments = [])\n{\n- $magicName = 'magic' . $name;\n+ $magicName = 'magic' . ucfirst($name);\nif (method_exists($this, $magicName)) {\nreturn $this->{$magicName}(...$arguments);\n}\n+\n+ throw new \\RuntimeException(sprintf('Invalid field name or method call on %s: %s', self::class, $name));\n}\npublic function get(string $name): ?Field\n@@ -187,13 +189,7 @@ trait ContentMagicTrait\n$titleParts[] = $this->get($field);\n}\n- $title = trim(implode(' ', $titleParts));\n-\n- if (empty($title)) {\n- return '(untitled)';\n- }\n-\n- return $title;\n+ return trim(implode(' ', $titleParts));\n}\npublic function magicImage(): array\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Field.php", "new_path": "src/Entity/Field.php", "diff": "@@ -184,6 +184,8 @@ class Field\n}\n/**\n+ * like getValue() but returns single value for single value fields\n+ *\n* @Groups({\"get_content\"})\n*\n* @return array|mixed|null\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/TwigRecordsView.php", "new_path": "src/Twig/TwigRecordsView.php", "diff": "@@ -63,16 +63,17 @@ class TwigRecordsView\nreturn $records;\n}\n- protected function processSingleRecord($record): void\n+ protected function processSingleRecord(Content $record): void\n{\n- $values = $record->getValues();\n- if (is_array($values)) {\n- foreach ($values as $field => $value) {\n- /* Get type of a field based on $record->getContentType() and $field */\n- $type = [];\n- $boltType = '';\n- $record->set($field, $this->transform($value, $boltType, $type));\n- }\n+ $values = $record->getFields();\n+ foreach ($values as $field) {\n+ $field->setValue(\n+ (array) $this->transform(\n+ $field->getFieldValue(),\n+ $field->getType(),\n+ $field->getValue()\n+ )\n+ );\n}\n}\n" } ]
PHP
MIT License
bolt/core
magic content fixes
95,144
16.01.2019 22:38:50
-3,600
739fef591542434151d3a5d82d14ed79387b2428
Cache config files
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Config.php", "new_path": "src/Configuration/Config.php", "diff": "@@ -8,6 +8,8 @@ use Bolt\\Common\\Arr;\nuse Bolt\\Configuration\\Parser\\ContentTypesParser;\nuse Bolt\\Configuration\\Parser\\GeneralParser;\nuse Bolt\\Configuration\\Parser\\TaxonomyParser;\n+use Symfony\\Component\\Cache\\Simple\\FilesystemCache;\n+use Symfony\\Component\\Stopwatch\\Stopwatch;\nuse Tightenco\\Collect\\Support\\Collection;\nclass Config\n@@ -18,17 +20,71 @@ class Config\n/** @var PathResolver */\nprivate $pathResolver;\n- public function __construct()\n+ /** @var Stopwatch */\n+ private $stopwatch;\n+\n+ /** @var FilesystemCache */\n+ private $cache;\n+\n+ /** @var array */\n+ private $timestamps = [];\n+\n+ public function __construct(Stopwatch $stopwatch)\n{\n+ $this->stopwatch = $stopwatch;\n+ $this->cache = new FilesystemCache();\n$this->pathResolver = new PathResolver(dirname(dirname(__DIR__)), []);\n+ $this->data = $this->getConfig();\n+ }\n+\n+ private function getConfig(): Collection\n+ {\n+ $this->stopwatch->start('bolt.parseconfig');\n+\n+ if ($this->validCache()) {\n+ $data = $this->getCache();\n+ } else {\n+ $data = $this->parseConfig();\n+ $this->setCache();\n+ }\n+\n+ $this->stopwatch->stop('bolt.parseconfig');\n- $this->data = $this->parseConfig();\n+ return $data;\n+ }\n+\n+ private function validCache(): bool\n+ {\n+ if (! $this->cache->has('config_cache') || ! $this->cache->has('config_timestamps')) {\n+ return false;\n+ }\n+\n+ $timestamps = $this->cache->get('config_timestamps');\n+\n+ foreach ($timestamps as $filename => $timestamp) {\n+ if (filemtime($filename) > $timestamp) {\n+ return false;\n+ }\n+ }\n+\n+ return true;\n+ }\n+\n+ private function getCache(): Collection\n+ {\n+ return $this->cache->get('config_cache');\n+ }\n+\n+ private function setCache(): void\n+ {\n+ $this->cache->set('config_cache', $this->data);\n+ $this->cache->set('config_timestamps', $this->timestamps);\n}\n/**\n* Load the configuration from the various YML files.\n*/\n- public function parseConfig(): Collection\n+ private function parseConfig(): Collection\n{\n$general = new GeneralParser();\n@@ -49,9 +105,27 @@ class Config\n//'permissions' => $this->parseConfigYaml('permissions.yml'),\n//'extensions' => $this->parseConfigYaml('extensions.yml'),\n+ $this->setTimestamps($general, $taxonomy, $contentTypes);\n+\nreturn $config;\n}\n+ private function setTimestamps(...$configs): void\n+ {\n+ $this->timestamps = [];\n+\n+ foreach ($configs as $config) {\n+ foreach ($config->getFilenames() as $file) {\n+ $this->timestamps[$file] = filemtime($file);\n+ }\n+ }\n+\n+ $envFilename = dirname(dirname(__DIR__)) . '/.env';\n+ if (file_exists($envFilename)) {\n+ $this->timestamps[$envFilename] = filemtime($envFilename);\n+ }\n+ }\n+\n/**\n* Get a config value, using a path.\n*\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/BaseParser.php", "new_path": "src/Configuration/Parser/BaseParser.php", "diff": "@@ -21,6 +21,9 @@ class BaseParser\n/** @var PathResolver */\nprotected $pathResolver;\n+ /** @var array */\n+ protected $filenames = [];\n+\npublic function __construct($accept_file_types = [])\n{\n$this->accept_file_types = $accept_file_types;\n@@ -44,9 +47,16 @@ class BaseParser\n$yaml = Yaml::parseFile($filename);\n+ $this->filenames[] = $filename;\n+\n// Unset the repeated nodes key after parse\nunset($yaml['__nodes']);\nreturn collect($yaml);\n}\n+\n+ public function getFilenames(): array\n+ {\n+ return $this->filenames;\n+ }\n}\n" } ]
PHP
MIT License
bolt/core
Cache config files
95,144
17.01.2019 14:10:36
-3,600
6936c92b21d1d4c37d31fca235307ece35295d15
Don't use `__DIR__`
[ { "change_type": "MODIFY", "old_path": "config/services.yaml", "new_path": "config/services.yaml", "diff": "@@ -18,6 +18,7 @@ services:\n$locales: '%app_locales%'\n$defaultLocale: '%locale%'\n$emailSender: '%app.notifications.email_sender%'\n+ $projectDir: '%kernel.project_dir%'\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/Configuration/Config.php", "new_path": "src/Configuration/Config.php", "diff": "@@ -27,11 +27,15 @@ class Config\n/** @var FilesystemCache */\nprivate $cache;\n- public function __construct(Stopwatch $stopwatch)\n+ /** @var string */\n+ private $projectDir;\n+\n+ public function __construct(Stopwatch $stopwatch, $projectDir)\n{\n$this->stopwatch = $stopwatch;\n$this->cache = new FilesystemCache();\n- $this->pathResolver = new PathResolver(dirname(dirname(__DIR__)), []);\n+ $this->pathResolver = new PathResolver($projectDir, []);\n+ $this->projectDir = $projectDir;\n$this->data = $this->getConfig();\n}\n@@ -116,7 +120,7 @@ class Config\n}\n}\n- $envFilename = dirname(dirname(__DIR__)) . '/.env';\n+ $envFilename = $this->projectDir . '/.env';\nif (file_exists($envFilename)) {\n$timestamps[$envFilename] = filemtime($envFilename);\n}\n" } ]
PHP
MIT License
bolt/core
Don't use `__DIR__`
95,144
17.01.2019 14:22:34
-3,600
4124b993fe6b1f049b3475b8da45a09b217f4cf5
Set cache files at same time
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Config.php", "new_path": "src/Configuration/Config.php", "diff": "@@ -48,8 +48,8 @@ class Config\nif ($this->validCache()) {\n$data = $this->getCache();\n} else {\n- $data = $this->parseConfig();\n- $this->setCache($data);\n+ [$data, $timestamps] = $this->parseConfig();\n+ $this->setCache($data, $timestamps);\n}\n$this->stopwatch->stop('bolt.parseconfig');\n@@ -79,15 +79,16 @@ class Config\nreturn $this->cache->get('config_cache');\n}\n- private function setCache($data): void\n+ private function setCache(Collection $data, array $timestamps): void\n{\n$this->cache->set('config_cache', $data);\n+ $this->cache->set('config_timestamps', $timestamps);\n}\n/**\n* Load the configuration from the various YML files.\n*/\n- private function parseConfig(): Collection\n+ private function parseConfig(): array\n{\n$general = new GeneralParser();\n@@ -107,12 +108,12 @@ class Config\n//'permissions' => $this->parseConfigYaml('permissions.yml'),\n//'extensions' => $this->parseConfigYaml('extensions.yml'),\n- $this->getConfigFilesTimestamps($general, $taxonomy, $contentTypes);\n+ $timestamps = $this->getConfigFilesTimestamps($general, $taxonomy, $contentTypes);\n- return $config;\n+ return [$config, $timestamps];\n}\n- private function getConfigFilesTimestamps(BaseParser ...$configs): void\n+ private function getConfigFilesTimestamps(BaseParser ...$configs): array\n{\n$timestamps = [];\n@@ -127,7 +128,7 @@ class Config\n$timestamps[$envFilename] = filemtime($envFilename);\n}\n- $this->cache->set('config_timestamps', $timestamps);\n+ return $timestamps;\n}\n/**\n" } ]
PHP
MIT License
bolt/core
Set cache files at same time
95,144
17.01.2019 14:48:56
-3,600
6eb7a38b4a435a6c303c5f6d524ed90d9b7a8752
Inject CacheInterface
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Config.php", "new_path": "src/Configuration/Config.php", "diff": "@@ -9,7 +9,7 @@ use Bolt\\Configuration\\Parser\\BaseParser;\nuse Bolt\\Configuration\\Parser\\ContentTypesParser;\nuse Bolt\\Configuration\\Parser\\GeneralParser;\nuse Bolt\\Configuration\\Parser\\TaxonomyParser;\n-use Symfony\\Component\\Cache\\Simple\\FilesystemCache;\n+use Psr\\SimpleCache\\CacheInterface;\nuse Symfony\\Component\\Stopwatch\\Stopwatch;\nuse Tightenco\\Collect\\Support\\Collection;\n@@ -24,16 +24,16 @@ class Config\n/** @var Stopwatch */\nprivate $stopwatch;\n- /** @var FilesystemCache */\n+ /** @var CacheInterface */\nprivate $cache;\n/** @var string */\nprivate $projectDir;\n- public function __construct(Stopwatch $stopwatch, $projectDir)\n+ public function __construct(Stopwatch $stopwatch, $projectDir, CacheInterface $cache)\n{\n$this->stopwatch = $stopwatch;\n- $this->cache = new FilesystemCache();\n+ $this->cache = $cache;\n$this->projectDir = $projectDir;\n$this->data = $this->getConfig();\n" } ]
PHP
MIT License
bolt/core
Inject CacheInterface
95,144
21.01.2019 19:25:32
-3,600
bc729fae77a901c7f8cb967c473557868c4fe22d
Don't break if Contenttype has no image
[ { "change_type": "MODIFY", "old_path": "src/Entity/ContentMagicTrait.php", "new_path": "src/Entity/ContentMagicTrait.php", "diff": "@@ -200,11 +200,7 @@ trait ContentMagicTrait\n}\n}\n- return [\n- 'filename' => '',\n- 'alt' => '',\n- 'path' => '',\n- ];\n+ return [];\n}\n/**\n" } ]
PHP
MIT License
bolt/core
Don't break if Contenttype has no image
95,144
21.01.2019 21:38:03
-3,600
f19e8c733d3a2c10c8968fb8722e474f3c6b730e
No double `Markup` required for text-like fields
[ { "change_type": "MODIFY", "old_path": "src/Storage/Query/Query.php", "new_path": "src/Storage/Query/Query.php", "diff": "@@ -5,24 +5,18 @@ declare(strict_types=1);\nnamespace Bolt\\Storage\\Query;\nuse Bolt\\Entity\\Content;\n-use Bolt\\Twig\\TwigRecordsView;\nclass Query\n{\n/** @var ContentQueryParser */\nprotected $parser;\n+\n/** @var array */\nprotected $scopes = [];\n- /** @var TwigRecordsView */\n- protected $recordsView;\n- /**\n- * Constructor.\n- */\n- public function __construct(ContentQueryParser $parser, TwigRecordsView $recordsView)\n+ public function __construct(ContentQueryParser $parser)\n{\n$this->parser = $parser;\n- $this->recordsView = $recordsView;\n$this->scopes = [];\n}\n@@ -78,8 +72,6 @@ class Query\n*/\npublic function getContentForTwig(string $textQuery, array $parameters = [])\n{\n- $results = $this->getContentByScope('frontend', $textQuery, $parameters);\n-\n- return $this->recordsView->createView($results);\n+ return $this->getContentByScope('frontend', $textQuery, $parameters);\n}\n}\n" }, { "change_type": "DELETE", "old_path": "src/Twig/TwigRecordsView.php", "new_path": null, "diff": "-<?php\n-\n-declare(strict_types=1);\n-\n-namespace Bolt\\Twig;\n-\n-use Bolt\\Entity\\Content;\n-use Bolt\\Storage\\Query\\QueryResultset;\n-use Twig\\Markup;\n-\n-/**\n- * Twig Records View, wraps content records before they are passed to Twig\n- * so appropriate transformation can occur.\n- *\n- * @author Ross Riley <riley.ross@gmail.com>\n- * @author Xiao-Hu Tai <xiao@twokings.nl>\n- */\n-class TwigRecordsView\n-{\n- /** @var array */\n- protected $transformers = [];\n-\n- /**\n- * Constructor.\n- */\n- public function __construct()\n- {\n- $this->setupDefaults();\n- }\n-\n- /**\n- * Here we register some transformers that prepare the fields to be passed to\n- * twig. For repeaters and blocks this is recursive.\n- */\n- protected function setupDefaults(): void\n- {\n- $this->addTransformer('html', function ($value) {\n- return new Markup($value, 'UTF-8');\n- });\n- $this->addTransformer('text', function ($value) {\n- return new Markup($value, 'UTF-8');\n- });\n- $this->addTransformer('textarea', function ($value) {\n- return new Markup($value, 'UTF-8');\n- });\n- }\n-\n- /**\n- * This loads the relevant record or records and activates the class.\n- *\n- * @param Content|QueryResultset $records\n- *\n- * @return Content|QueryResultset\n- */\n- public function createView($records)\n- {\n- if ($records instanceof Content) {\n- $this->processSingleRecord($records);\n- } elseif ($records instanceof QueryResultset) {\n- $this->processRecords($records);\n- }\n-\n- return $records;\n- }\n-\n- protected function processSingleRecord(Content $record): void\n- {\n- $values = $record->getFields();\n- foreach ($values as $field) {\n- $field->setValue(\n- (array) $this->transform(\n- $field->getFieldValue(),\n- $field->getType(),\n- $field->getValue()\n- )\n- );\n- }\n- }\n-\n- protected function processRecords($records): void\n- {\n- foreach ($records as $record) {\n- $this->processSingleRecord($record);\n- }\n- }\n-\n- /**\n- * Adds a transformer callback to the field type $label.\n- */\n- public function addTransformer($label, callable $callback): void\n- {\n- $this->transformers[$label] = $callback;\n- }\n-\n- /**\n- * Checks if a transformer is registered for $label.\n- */\n- public function hasTransformer($label): bool\n- {\n- return array_key_exists($label, $this->transformers);\n- }\n-\n- /**\n- * @return array|mixed\n- */\n- public function getTransformer($label)\n- {\n- if ($this->hasTransformer($label)) {\n- return $this->transformers[$label];\n- }\n- }\n-\n- protected function transform($value, $label, array $fieldData = [])\n- {\n- if ($this->hasTransformer($label)) {\n- return $this->transformers[$label]($value, $fieldData);\n- }\n-\n- return $value;\n- }\n-}\n" } ]
PHP
MIT License
bolt/core
No double `Markup` required for text-like fields
95,132
22.01.2019 11:10:37
-3,600
e828ffb6e251d8d8140454b831cf8388a40af31d
Return value can be Content|QueryResultset|null
[ { "change_type": "MODIFY", "old_path": "src/Storage/Query/Handler/SelectQueryHandler.php", "new_path": "src/Storage/Query/Handler/SelectQueryHandler.php", "diff": "@@ -14,7 +14,7 @@ use Bolt\\Storage\\Query\\SelectQuery;\n*/\nclass SelectQueryHandler\n{\n- public function __invoke(ContentQueryParser $contentQuery): ?QueryResultset\n+ public function __invoke(ContentQueryParser $contentQuery)\n{\n$set = new QueryResultset();\n/** @var SelectQuery $query */\n" } ]
PHP
MIT License
bolt/core
Return value can be Content|QueryResultset|null
95,132
22.01.2019 11:34:20
-3,600
1ef103fb148b880b5ec388ce80c26af032fd0013
Fix query See
[ { "change_type": "MODIFY", "old_path": "src/Storage/Query/Handler/SelectQueryHandler.php", "new_path": "src/Storage/Query/Handler/SelectQueryHandler.php", "diff": "@@ -14,6 +14,9 @@ use Bolt\\Storage\\Query\\SelectQuery;\n*/\nclass SelectQueryHandler\n{\n+ /**\n+ * @return Content|QueryResultSet|null\n+ */\npublic function __invoke(ContentQueryParser $contentQuery)\n{\n$set = new QueryResultset();\n" }, { "change_type": "MODIFY", "old_path": "src/Storage/Query/Query.php", "new_path": "src/Storage/Query/Query.php", "diff": "@@ -72,6 +72,13 @@ class Query\n*/\npublic function getContentForTwig(string $textQuery, array $parameters = [])\n{\n+ if (func_num_args() === 3) {\n+ $whereparameters = func_get_arg(2);\n+ if (is_array($whereparameters) && ! empty($whereparameters)) {\n+ $parameters = array_merge($parameters, $whereparameters);\n+ }\n+ }\n+\nreturn $this->getContentByScope('frontend', $textQuery, $parameters);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Storage/Query/QueryParameterParser.php", "new_path": "src/Storage/Query/QueryParameterParser.php", "diff": "@@ -280,16 +280,16 @@ class QueryParameterParser\n* 'matched' => <the pattern that the value matched>\n* ]\n*\n- * @param string $value Value to process\n+ * @param $value Value to process\n*\n* @return array Parsed values\n*/\n- public function parseValue(string $value): array\n+ public function parseValue($value): array\n{\nforeach ($this->valueMatchers as $matcher) {\n$regex = sprintf('/%s/u', $matcher['token']);\n$values = $matcher['params'];\n- if (preg_match($regex, $value)) {\n+ if (preg_match($regex, (string) $value)) {\nif (is_callable($values['value'])) {\npreg_match($regex, $value, $output);\n$values['value'] = $values['value']($output[1]);\n" } ]
PHP
MIT License
bolt/core
Fix query See 1624cdc
95,132
22.01.2019 12:20:34
-3,600
9d602d7d8799ecd2415ecd99d478bb678dd61909
Simplify `getContentForTwig`
[ { "change_type": "MODIFY", "old_path": "src/Storage/Query/Query.php", "new_path": "src/Storage/Query/Query.php", "diff": "@@ -70,14 +70,9 @@ class Query\n/**\n* Helper to be called from Twig that is passed via a TwigRecordsView rather than the raw records.\n*/\n- public function getContentForTwig(string $textQuery, array $parameters = [])\n+ public function getContentForTwig(string $textQuery, array $parameters = [], array $whereParameters = [])\n{\n- if (func_num_args() === 3) {\n- $whereparameters = func_get_arg(2);\n- if (is_array($whereparameters) && ! empty($whereparameters)) {\n- $parameters = array_merge($parameters, $whereparameters);\n- }\n- }\n+ $parameters = array_merge($parameters, $whereParameters);\nreturn $this->getContentByScope('frontend', $textQuery, $parameters);\n}\n" } ]
PHP
MIT License
bolt/core
Simplify `getContentForTwig`
95,132
22.01.2019 14:43:33
-3,600
de5e73d8f03f0be58b33d0a9fdfc9ce446554f8d
Add `@param` phpdoc to `getContentForTwig`
[ { "change_type": "MODIFY", "old_path": "src/Storage/Query/Query.php", "new_path": "src/Storage/Query/Query.php", "diff": "@@ -69,6 +69,11 @@ class Query\n/**\n* Helper to be called from Twig that is passed via a TwigRecordsView rather than the raw records.\n+ *\n+ * @param $textQuery Base part of setcontent like `pages` or `pages/1`\n+ * @param $parameters Parameters like `printquery` and `paging`\n+ * @param $whereParameters Actual `where` parameters taken from `... where { foo: bar } ...`\n+\n*/\npublic function getContentForTwig(string $textQuery, array $parameters = [], array $whereParameters = [])\n{\n" } ]
PHP
MIT License
bolt/core
Add `@param` phpdoc to `getContentForTwig`
95,132
22.01.2019 18:04:23
-3,600
5b67d8ce0bf0d4197e4bf44923d7d3b0ffb488be
Add type hints to phpdoc
[ { "change_type": "MODIFY", "old_path": "src/Storage/Query/Query.php", "new_path": "src/Storage/Query/Query.php", "diff": "@@ -70,9 +70,9 @@ class Query\n/**\n* Helper to be called from Twig that is passed via a TwigRecordsView rather than the raw records.\n*\n- * @param $textQuery Base part of setcontent like `pages` or `pages/1`\n- * @param $parameters Parameters like `printquery` and `paging`\n- * @param $whereParameters Actual `where` parameters taken from `... where { foo: bar } ...`\n+ * @param string $textQuery The base part like `pages` or `pages/1`\n+ * @param array $parameters Parameters like `printquery` and `paging`\n+ * @param array $whereParameters Actual `where` parameters taken from `... where { foo: bar } ...`\n*/\npublic function getContentForTwig(string $textQuery, array $parameters = [], array $whereParameters = [])\n" }, { "change_type": "MODIFY", "old_path": "src/Storage/Query/QueryParameterParser.php", "new_path": "src/Storage/Query/QueryParameterParser.php", "diff": "@@ -280,7 +280,7 @@ class QueryParameterParser\n* 'matched' => <the pattern that the value matched>\n* ]\n*\n- * @param $value Value to process\n+ * @param mixed $value Value to process\n*\n* @return array Parsed values\n*/\n" } ]
PHP
MIT License
bolt/core
Add type hints to phpdoc
95,132
22.01.2019 18:16:47
-3,600
8a43d482fc03106d073c54250adb359873650afd
Set correct alignment for phpdoc
[ { "change_type": "MODIFY", "old_path": "src/Storage/Query/Query.php", "new_path": "src/Storage/Query/Query.php", "diff": "@@ -73,7 +73,6 @@ class Query\n* @param string $textQuery The base part like `pages` or `pages/1`\n* @param array $parameters Parameters like `printquery` and `paging`\n* @param array $whereParameters Actual `where` parameters taken from `... where { foo: bar } ...`\n-\n*/\npublic function getContentForTwig(string $textQuery, array $parameters = [], array $whereParameters = [])\n{\n" } ]
PHP
MIT License
bolt/core
Set correct alignment for phpdoc
95,144
23.01.2019 15:24:04
-3,600
2a14b180be3134a63c63f2e2c85d77e889d25bff
Ported `setcontent` tests.
[ { "change_type": "ADD", "old_path": null, "new_path": "tests/php/Twig/AbstractTestTokenParser.php", "diff": "+<?php\n+\n+declare(strict_types=1);\n+\n+namespace Bolt\\Tests\\Twig;\n+\n+use Twig\\Environment;\n+use Twig\\Loader\\LoaderInterface;\n+use Twig\\Node\\Node;\n+use Twig\\Parser;\n+use Twig\\TokenParser\\AbstractTokenParser;\n+use Twig\\TokenStream;\n+\n+/**\n+ * Abstract TokenParser test base.\n+ *\n+ * @author Gawain Lynch <gawain.lynch@gmail.com>\n+ * @author Bob den Otter <bobdenotter@gmail.com>\n+ */\n+abstract class AbstractTestTokenParser extends \\PHPUnit\\Framework\\TestCase\n+{\n+ protected function getParser(TokenStream $tokenStream, AbstractTokenParser $testParser): Parser\n+ {\n+ $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock());\n+ $parser = new Parser($env);\n+ $parser->setParent(new Node());\n+ $env->addTokenParser($testParser);\n+\n+ $p = new \\ReflectionProperty($parser, 'stream');\n+ $p->setAccessible(true);\n+ $p->setValue($parser, $tokenStream);\n+\n+ return $parser;\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "tests/php/Twig/SetcontentTokenParserTest.php", "diff": "+<?php\n+\n+declare(strict_types=1);\n+\n+namespace Bolt\\Tests\\Twig;\n+\n+use Bolt\\Twig\\Node\\SetcontentNode;\n+use Bolt\\Twig\\TokenParser\\SetcontentTokenParser;\n+use Twig\\Compiler;\n+use Twig\\Environment;\n+use Twig\\Loader\\LoaderInterface;\n+use Twig\\Node\\BodyNode;\n+use Twig\\Node\\ModuleNode;\n+use Twig\\Source;\n+use Twig\\Token;\n+use Twig\\TokenParser\\AbstractTokenParser;\n+use Twig\\TokenStream;\n+\n+/**\n+ * Class to test Twig {% setcontent %} token classes.\n+ *\n+ * @author Gawain Lynch <gawain.lynch@gmail.com>\n+ * @author Bob den Otter <bobdenotter@gmail.com>\n+ */\n+class SetcontentTokenParserTest extends AbstractTestTokenParser\n+{\n+ public function testClass(): void\n+ {\n+ $setContentParser = new SetcontentTokenParser();\n+ $this->assertInstanceOf(AbstractTokenParser::class, $setContentParser);\n+ }\n+\n+ public function testGetTag(): void\n+ {\n+ $setContentParser = new SetcontentTokenParser();\n+ $this->assertSame('setcontent', $setContentParser->getTag());\n+ }\n+\n+ public function testParse(): void\n+ {\n+ $name = 'Beaker';\n+ $where = \"{ status: 'published', datepublish: '> 2019-01-14', taxonomy: 'main|||meta|||other' }\";\n+ $contentType = 'pages';\n+ $limit = 5;\n+ $streamTokens = [\n+ new Token(Token::BLOCK_START_TYPE, '', 1),\n+ new Token(Token::NAME_TYPE, 'setcontent', 1),\n+\n+ new Token(Token::NAME_TYPE, $name, 1),\n+ new Token(Token::OPERATOR_TYPE, '=', 2),\n+ new Token(Token::STRING_TYPE, $contentType, 3),\n+\n+ new Token(Token::NAME_TYPE, 'where', 4),\n+ new Token(Token::STRING_TYPE, $where, 5),\n+\n+ new Token(Token::NAME_TYPE, 'limit', 6),\n+ new Token(Token::NUMBER_TYPE, $limit, 7),\n+\n+ new Token(Token::NAME_TYPE, 'order', 8),\n+ new Token(Token::STRING_TYPE, '-name', 9),\n+\n+ new Token(Token::NAME_TYPE, 'orderby', 10),\n+ new Token(Token::STRING_TYPE, 'title', 11),\n+\n+ new Token(Token::NAME_TYPE, 'paging', 12),\n+ new Token(Token::NAME_TYPE, 'allowpaging', 13),\n+\n+ new Token(Token::NAME_TYPE, 'printquery', 14),\n+\n+ new Token(Token::NAME_TYPE, 'returnsingle', 15),\n+\n+ new Token(Token::NAME_TYPE, 'nohydrate', 16),\n+\n+ new Token(Token::BLOCK_END_TYPE, '', 98),\n+ new Token(Token::EOF_TYPE, '', 99),\n+ ];\n+ $twigTokenStream = new TokenStream($streamTokens, new Source(null, 'clippy'));\n+\n+ $parser = $this->getParser($twigTokenStream, new SetcontentTokenParser());\n+\n+ /** @var ModuleNode $setContentNode */\n+ $setContentNode = $parser->parse($twigTokenStream);\n+\n+ /** @var BodyNode $bodyNodes */\n+ $bodyNodes = $setContentNode->getNode('body');\n+\n+ /** @var SetcontentNode $bodyNode */\n+ foreach ($bodyNodes->getIterator() as $bodyNode) {\n+ $this->assertSame($name, $bodyNode->getAttribute('name'));\n+ $this->assertSame($where, $bodyNode->getNode('wherearguments')->getAttribute('value'));\n+\n+ $this->assertSame($contentType, $bodyNode->getAttribute('contentType')->getAttribute('value'));\n+\n+ $nodes = $bodyNode->getAttribute('arguments')->getKeyValuePairs();\n+\n+ $this->assertSame('limit', $nodes[0]['key']->getAttribute('value'));\n+ $this->assertSame($limit, $nodes[0]['value']->getAttribute('value'));\n+\n+ $this->assertSame('order', $nodes[1]['key']->getAttribute('value'));\n+ $this->assertSame('-name', $nodes[1]['value']->getAttribute('value'));\n+\n+ $this->assertSame('order', $nodes[2]['key']->getAttribute('value'));\n+ $this->assertSame('title', $nodes[2]['value']->getAttribute('value'));\n+\n+ $this->assertSame('paging', $nodes[3]['key']->getAttribute('value'));\n+ $this->assertTrue($nodes[3]['value']->getAttribute('value'));\n+\n+ $this->assertSame('paging', $nodes[4]['key']->getAttribute('value'));\n+ $this->assertTrue($nodes[4]['value']->getAttribute('value'));\n+\n+ $this->assertSame('printquery', $nodes[5]['key']->getAttribute('value'));\n+ $this->assertTrue($nodes[5]['value']->getAttribute('value'));\n+\n+ $this->assertSame('returnsingle', $nodes[6]['key']->getAttribute('value'));\n+ $this->assertTrue($nodes[6]['value']->getAttribute('value'));\n+\n+ $this->assertSame('hydrate', $nodes[7]['key']->getAttribute('value'));\n+ $this->assertFalse($nodes[7]['value']->getAttribute('value'));\n+ }\n+\n+ $loader = $this->getMockBuilder(LoaderInterface::class)->getMock();\n+\n+ $env = new Environment($loader, [\n+ 'cache' => false,\n+ 'autoescape' => false,\n+ 'optimizations' => 0,\n+ ]);\n+\n+ $compiler = $this->getMockBuilder(Compiler::class)\n+ ->setMethods(['raw', 'subcompile', 'write'])\n+ ->setConstructorArgs([$env])\n+ ->getMock();\n+\n+ $compiler->expects($this->atLeast(3))\n+ ->method('raw')\n+ ->willReturnSelf();\n+\n+ $compiler->expects($this->atLeast(3))\n+ ->method('subcompile')\n+ ->willReturnSelf();\n+\n+ $compiler->expects($this->atLeast(1))\n+ ->method('write')\n+ ->willReturnSelf();\n+\n+ /** @var Compiler $compiler */\n+ $setContentNode->compile($compiler);\n+ }\n+}\n" } ]
PHP
MIT License
bolt/core
Ported `setcontent` tests.
95,144
23.01.2019 17:36:39
-3,600
d291716f679216287c0bf751834620b8bbf40bf9
Rename class to TokenParserTestCase
[ { "change_type": "MODIFY", "old_path": "tests/php/Twig/SetcontentTokenParserTest.php", "new_path": "tests/php/Twig/SetcontentTokenParserTest.php", "diff": "@@ -22,7 +22,7 @@ use Twig\\TokenStream;\n* @author Gawain Lynch <gawain.lynch@gmail.com>\n* @author Bob den Otter <bobdenotter@gmail.com>\n*/\n-class SetcontentTokenParserTest extends AbstractTestTokenParser\n+class SetcontentTokenParserTest extends TokenParserTestCase\n{\npublic function testClass(): void\n{\n" }, { "change_type": "RENAME", "old_path": "tests/php/Twig/AbstractTestTokenParser.php", "new_path": "tests/php/Twig/TokenParserTestCase.php", "diff": "@@ -17,7 +17,7 @@ use Twig\\TokenStream;\n* @author Gawain Lynch <gawain.lynch@gmail.com>\n* @author Bob den Otter <bobdenotter@gmail.com>\n*/\n-abstract class AbstractTestTokenParser extends \\PHPUnit\\Framework\\TestCase\n+abstract class TokenParserTestCase extends \\PHPUnit\\Framework\\TestCase\n{\nprotected function getParser(TokenStream $tokenStream, AbstractTokenParser $testParser): Parser\n{\n" } ]
PHP
MIT License
bolt/core
Rename class to TokenParserTestCase
95,144
17.01.2019 19:10:07
-3,600
224f7278088db58b77d7bc3133429fe205397c1f
Fixing missing attributes on Dashboard
[ { "change_type": "MODIFY", "old_path": "assets/js/app/listing/Components/Table/Row/_Actions.vue", "new_path": "assets/js/app/listing/Components/Table/Row/_Actions.vue", "diff": "<div class=\"listing__row--item is-actions\">\n<ul class=\"listing--actions\">\n<li>\n- <a :href=\"`/bolt/edit/${id}`\" class=\"link\">\n+ <a :href=\"record.editLink\" class=\"link\">\n<div class=\"btn-group\">\n<button class=\"btn btn-grey btn-block btn-sm\" type=\"button\">\n<i class=\"far fa-edit mr-1\"></i> Edit\n<script>\nexport default {\nname: \"actions\",\n- props: [\"id\", \"size\"],\n+ props: [\"record\"],\nmethods:{\nquickEditor(){\nthis.$emit('quickeditor', true);\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": "<row-meta\n:type=\"type\"\n:size=\"size\"\n- :meta=\"record\"\n+ :record=\"record\"\n></row-meta>\n<!-- end column -->\n<!-- column actions -->\n<row-actions\n- :id=\"record.id\"\n+ :record=\"record\"\n:size=\"size\"\n@quickeditor=\"quickEditor = $event\"\n></row-actions>\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/_content_listing.html.twig", "new_path": "templates/_partials/_content_listing.html.twig", "diff": "-\n-\n-\n{% if records %}\n<!-- listing records -->\n<listing-records\n<listing-table ></listing-table>\n- {# <draggable :options=\"{handle:'.listing__row--move', animation: 0}\">\n-\n- {% for record in records %}\n- <listing-row\n- type=\"{{ type }}\"\n- :record-id=\"'{{ record.id }}'\"\n- :definition=\"{{ record.definition|json_encode() }}\"\n- :excerpt=\"{{ record.excerpt(150, true)|json_encode() }}\"\n- :status=\"'{{ record.status }}'\"\n- :thumbnail=\"'{{ record.image|thumbnail(150, 100) }}'\"\n- :date=\"{\n- published: '{{ record.publishedAt|localizeddate('medium', 'none', null, 'UTC') }}',\n- created: '{{ record.datecreated|date(\"Y-m-d H:i\") }}',\n- changed: '{{ record.datechanged|date(\"Y-m-d H:i\") }}'\n- }\"\n- author=\"{{record.author}}\"\n- >\n- </listing-row>\n- {% endfor %}\n- </draggable> #}\n-\n<nav class=\"listing__filter\">\n{% include '@bolt/_partials/_pager.html.twig' with { 'records': records } %}\n</nav>\n" }, { "change_type": "MODIFY", "old_path": "templates/dashboard/dashboard.html.twig", "new_path": "templates/dashboard/dashboard.html.twig", "diff": "<i class='fas mr-2 fa-tachometer-alt'></i><strong>{{ 'caption.dashboard'|trans }}</strong>\n{% endblock title %}\n+{# This 'topsection' gets output _before_ the main form, allowing `dump()`, without breaking Vue #}\n+{% block topsection %}\n+\n+{% endblock %}\n+\n{% block main %}\n<div id=\"listing\">\n{% include '@bolt/_partials/_content_listing.html.twig' with {'records': records, 'type': 'dashboard' } %}\n" } ]
PHP
MIT License
bolt/core
Fixing missing attributes on Dashboard
95,144
24.01.2019 15:47:51
-3,600
4f3f4b1dbb9f1657e66809cfa0aa5d001f6626d1
Add `allowempty` flag to prevent save record with empty status
[ { "change_type": "MODIFY", "old_path": "assets/js/app/editor/Components/Editor/Select/Select.vue", "new_path": "assets/js/app/editor/Components/Editor/Select/Select.vue", "diff": ":multiple=\"multiple\"\n:taggable=\"taggable\"\n:searchable=\"taggable\"\n+ :allow-empty=\"allowempty\"\ntag-placeholder=\"Add this as new tag\"\ntag-position=\"bottom\"\n@tag=\"addTag\"\n@@ -38,7 +39,7 @@ import Multiselect from 'vue-multiselect';\nexport default {\nname: 'editor-select',\n- props: ['value', 'name', 'id', 'form', 'options', 'multiple', 'taggable'],\n+ props: ['value', 'name', 'id', 'form', 'options', 'multiple', 'taggable', 'allowempty'],\ncomponents: { Multiselect },\nmounted() {\nconst _values = this.value;\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/select.html.twig", "new_path": "templates/_partials/fields/select.html.twig", "diff": "{% set multiple = 'false' %}\n{% endif %}\n+{% if field.allowempty is defined %}\n+ {% set allowempty = field.definition.get('allowempty') ? 'true' : 'false' %}\n+{% else %}\n+ {% set allowempty = allowempty ? 'true' : 'false' %}\n+{% endif %}\n+\n{% block field %}\n{#<pre><code>{{ value|json_encode() }}</code></pre>#}\n<editor-select\n:options=\"{{ options|json_encode() }}\"\n:form=\"'{{ form }}'\"\n:multiple=\"{{ multiple }}\"\n+ :allowempty=\"{{ allowempty }}\"\n></editor-select>\n{% endblock %}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_fields_aside.html.twig", "new_path": "templates/content/_fields_aside.html.twig", "diff": "'name' : 'status',\n'value' : [record.status],\n'options' : record.statusoptions,\n- 'form' : 'editcontent'\n+ 'form' : 'editcontent',\n+ 'allowempty' : false\n} %}\n{% include '@bolt/_partials/fields/date.html.twig' with {\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_taxonomies.html.twig", "new_path": "templates/content/_taxonomies.html.twig", "diff": ":options=\"{{ options|json_encode() }}\"\n:multiple=\"{{ definition.multiple ? 'true' : 'false' }}\"\n:taggable=\"{{ (definition.behaves_like == 'tags') ? 'true' : 'false' }}\"\n+ :allowempty={{ definition.allow_empty ? 'true' : 'false' }}\n></editor-select>\n{# (Current saved value: <code>{{ value|json_encode() }}</code> ) #}\n" } ]
PHP
MIT License
bolt/core
Add `allowempty` flag to prevent save record with empty status
95,144
24.01.2019 16:45:00
-3,600
3054f00c403c93e0c24cd00f54c5be323c1ca7b5
Fixing logic in select.hml.twig
[ { "change_type": "MODIFY", "old_path": "templates/_partials/fields/select.html.twig", "new_path": "templates/_partials/fields/select.html.twig", "diff": "{% set multiple = 'false' %}\n{% endif %}\n-{% if field.allowempty is defined %}\n+{% if allowempty is not defined and field.definition is defined %}\n{% set allowempty = field.definition.get('allowempty') ? 'true' : 'false' %}\n{% else %}\n- {% set allowempty = allowempty ? 'true' : 'false' %}\n+ {% set allowempty = allowempty|default() ? 'true' : 'false' %}\n{% endif %}\n{% block field %}\n" } ]
PHP
MIT License
bolt/core
Fixing logic in select.hml.twig
95,144
25.01.2019 11:48:18
-3,600
9a9972f91ce13481add495b05b7332ab559a5804
Expanded the description for select.html.twig
[ { "change_type": "MODIFY", "old_path": "templates/_partials/fields/select.html.twig", "new_path": "templates/_partials/fields/select.html.twig", "diff": "{% extends '@bolt/_partials/fields/_base.html.twig' %}\n-{# Check Attributes #}\n-{% if form is not defined %}\n- {% set form = '' %}\n-{% endif %}\n+{# On top of the attributes that get set/defined in `_base.html.twig`,\n+ The Select fields has three additional attributes:\n+\n+ - options: The actual options that are available in the select\n+ - multiple: A boolean to set whether or not we allow multiple selections\n+ - allowempty: A boolean to set whether or not we allow clearing the selection\n+ #}\n{% if options is not defined %}\n{% set options = selectoptionsfromarray(field) %}\n" } ]
PHP
MIT License
bolt/core
Expanded the description for select.html.twig
95,144
25.01.2019 15:41:17
-3,600
bc869c5bba23b48806c1a0719f7a6a240293ba41
Added description to _base.html.twig
[ { "change_type": "MODIFY", "old_path": "templates/_partials/fields/_base.html.twig", "new_path": "templates/_partials/fields/_base.html.twig", "diff": "{%- spaceless -%}\n+{# This template fragment is used to \"extend\" the different fields, used in\n+ Bolt's backend. Most of the values get passed in, either through a `Field`,\n+ or otherwise through parameters.\n+\n+ The used variables are: (\"P\" is parameter, \"F\" comes from a `Field`)\n+\n+ - type: P - The type of the field\n+ - variant: F - the \"variant\" of the field, if applicable\n+ - name: P+F - The `name` attribute of the <input> field\n+ - id: P+F - The `id` attribut of the <input> field\n+ - class: P+F - The `class` attribute of the <input> field\n+ - form: P - The `form` attribute of the <input>, defaults to 'editcontent'\n+ - value: P+F - The default value if the <input> field\n+ - label: P+F - Label used as visible anchor to the <input> field\n+ - placeholder: P+F - Placeholder text to use in the <input>\n+ - prefix: P+F - Short text to display as a prefix before a field\n+ - postfix: P+F - Short text to display as a postfix after a field\n+\n+ #}\n+\n{# Set type #}\n{% set type = field.type|default %}\n" } ]
PHP
MIT License
bolt/core
Added description to _base.html.twig
95,144
25.01.2019 16:19:51
-3,600
35a462b98a7b4f74485af26e8cc5e9e5bacf33b5
Fix links in sidebar
[ { "change_type": "MODIFY", "old_path": "assets/js/app/sidebar/Components/Menu/_SubMenu.vue", "new_path": "assets/js/app/sidebar/Components/Menu/_SubMenu.vue", "diff": "</template>\n<script>\n-import SubMenu from './_SubMenu';\nexport default {\nname: \"sub-menu\",\n" }, { "change_type": "MODIFY", "old_path": "src/Content/MenuBuilder.php", "new_path": "src/Content/MenuBuilder.php", "diff": "@@ -304,15 +304,8 @@ class MenuBuilder\nforeach ($child->getChildren() as $submenuChild) {\n$submenu[] = [\n'name' => $submenuChild->getExtra('name') ?: $submenuChild->getLabel(),\n- 'singular_name' => $submenuChild->getExtra('singular_name'),\n- 'slug' => $submenuChild->getExtra('slug'),\n- 'singular_slug' => $submenuChild->getExtra('singular_slug'),\n'icon' => $submenuChild->getExtra('icon'),\n- 'link' => $submenuChild->getUri(),\n- 'link_new' => $submenuChild->getExtra('link_new'),\n- 'contenttype' => $submenuChild->getExtra('contenttype'),\n- 'singleton' => $submenuChild->getExtra('singleton'),\n- 'type' => $submenuChild->getExtra('type'),\n+ 'editLink' => $submenuChild->getUri(),\n'active' => $submenuChild->getExtra('active'),\n];\n}\n" } ]
PHP
MIT License
bolt/core
Fix links in sidebar
95,144
25.01.2019 16:57:59
-3,600
454bb41e3f785848f84f687e6d96a494672a460d
Fix Filemanager screen due to stricter typehints
[ { "change_type": "MODIFY", "old_path": "src/Controller/Backend/FilemanagerController.php", "new_path": "src/Controller/Backend/FilemanagerController.php", "diff": "@@ -43,7 +43,7 @@ class FilemanagerController extends BaseController\n*/\npublic function filemanager(string $area, Request $request, MediaRepository $mediaRepository): Response\n{\n- $path = $request->query->get('path');\n+ $path = $request->query->get('path', '');\nif (! str::endsWith($path, '/')) {\n$path .= '/';\n}\n" } ]
PHP
MIT License
bolt/core
Fix Filemanager screen due to stricter typehints
95,144
25.01.2019 09:08:02
-3,600
6a9ac1da01066844da10eb78dff154279e87b005
Minor restructuring for fields
[ { "change_type": "MODIFY", "old_path": "templates/_partials/fields/_base.html.twig", "new_path": "templates/_partials/fields/_base.html.twig", "diff": "{% set type = field.type|default %}\n{# Set variant #}\n-{% set variant = define.variant|default('normal') %}\n+{% set variant = field.variant|default('normal') %}\n{# Set the name #}\n{% if not name|default %}\n- {% set name = 'fields[' ~ field.name ~ ']' %}\n+ {% set name = 'fields[' ~ field.name|default('unnamed') ~ ']' %}\n{% endif %}\n{# Set the id #}\n{% if not id|default %}\n- {% set id = 'field-' ~ field.name|default(name) %}\n+ {% set id = 'field-' ~ field.name|default('unnamed') %}\n{% endif %}\n{# Set the form #}\n{% set class = field.definition.class|default %}\n{% endif %}\n-{% set class = class %}\n-\n{# Set the label #}\n{% if not label|default %}\n- {% set label = field.definition.label|default(field.name|ucwords) ~ ':' %}\n+ {% set label = field.definition.label|default(field.name|default('unnamed')|ucwords) %}\n+{% endif %}\n+{% set label = label|trim(':') ~ ':' %}\n+\n+{# Set the placeholder #}\n+{% if not placeholder|default %}\n+ {% set placeholder = field.definition.placeholder|default('') %}\n{% endif %}\n+{# Set the locale #}\n{% set localize = field.definition.localize|default %}\n{# Set the prefix and postfix attributes #}\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/generic.html.twig", "new_path": "templates/_partials/fields/generic.html.twig", "diff": "{% extends '@bolt/_partials/fields/_base.html.twig' %}\n{% block field %}\n- <input name=\"{{ name }}\" placeholder=\"First Name\" type=\"text\" value=\"{{ value|join(\", \") }}\" class=\"form-control {{ class }}\" {{ attributes|default()|raw }}>\n+ <input name=\"{{ name }}\" placeholder=\"{{ placeholder }}\" type=\"text\" value=\"{{ value|join(\", \") }}\" class=\"form-control {{ class }}\" {{ attributes|default()|raw }}>\n{% endblock %}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_fields.html.twig", "new_path": "templates/content/_fields.html.twig", "diff": "aria-labelledby=\"{{ group|slug }}-tab\">\n{% for key, fielddefinition in record.definition.fields if fielddefinition.group == group %}\n- {% set type = fielddefinition.type %}\n-\n{% if record.hasField(key) %}\n{% set field = record.getField(key) | translated(currentlocale) %}\n{% else %}\n{% endif %}\n{% include [\n- '_partials/fields/' ~ type ~ '.html.twig',\n+ '_partials/fields/' ~ fielddefinition.type ~ '.html.twig',\n'_partials/fields/generic.html.twig'\n] with {\n- 'field' : field,\n- 'define' : fielddefinition\n+ 'field' : field\n} %}\n{% endfor %}\n" }, { "change_type": "MODIFY", "old_path": "templates/pages/placeholder.html.twig", "new_path": "templates/pages/placeholder.html.twig", "diff": "{{ macro.button('action.save', 'fa-save', 'dark', 'button', '') }}\n{{ macro.button('action.save', 'fa-save', 'link', 'button', '') }}\n+ <hr>\n+\n+ <h1>Fields</h1>\n+\n+ <form method=\"post\" id=\"editor\">\n+\n+ {% include ['_partials/fields/generic.html.twig'] %}\n+\n+ {% include ['_partials/fields/generic.html.twig'] with {\n+ 'name': 'foo',\n+ 'id': 'bar',\n+ 'label': 'A Field',\n+ 'placeholder': 'Just a dummy field'\n+ } %}\n+\n+ {% setcontent record = 'homepage' returnsingle %}\n+ {% for key, fielddefinition in record.definition.fields %}\n+\n+ {% set field = record.field(key, 'en', false, fielddefinition) %}\n+\n+ {% include [\n+ '_partials/fields/' ~ fielddefinition.type ~ '.html.twig',\n+ '_partials/fields/generic.html.twig'\n+ ] with { 'field' : field } %}\n+\n+ {% endfor %}\n+\n+ {# @todo Add more fields #}\n+ </form>\n+\n</div>\n</div>\n" } ]
PHP
MIT License
bolt/core
Minor restructuring for fields
95,144
25.01.2019 11:09:09
-3,600
b11e45cf096b390e7c8cb6a4c7271c96c9a23ac7
Adding some e2e tests
[ { "change_type": "MODIFY", "old_path": "tests/e2e/features/edit_record.feature", "new_path": "tests/e2e/features/edit_record.feature", "diff": "Feature: Edit record\n- @wip\nScenario: As an Admin I want to change title of a record\nGiven I am logged in as \"admin\"\n" }, { "change_type": "ADD", "old_path": null, "new_path": "tests/e2e/features/kitchensink.feature", "diff": "+Feature: Visiting the Kitchensink\n+ Scenario: As an admin I want to see the Kitchensink page\n+ Given I am logged in as \"admin\"\n+ When I visit the \"kitchensink\" page\n+ Then there is element \"header\" with text \"Kitchensink\"\n+ And there is element \"header\" with text \"different things\"\n+ And there is element \"title\" with text \"Kitchensink\"\n+ And there is element \"subtitle\" with text \"different things\"\n+\n+ And there are \"equal 10\" \"buttons\" elements\n+\n+ And there is element \"field\" with text \"FooBar\"\n+\n+ And there is element \"title_label\" with text \"Title:\"\n+ And the \"title_field\" element is visible\n+ And there is element \"title_postfix\" with text \"shown on the homepage\"\n+\n" }, { "change_type": "ADD", "old_path": null, "new_path": "tests/e2e/pages/kitchensink.js", "diff": "+const { BasePage } = require('kakunin');\n+\n+class KitchensinkPage extends BasePage {\n+ constructor() {\n+ super();\n+\n+ this.url = '/bolt/kitchensink';\n+\n+ this.header = $('.admin__header--title');\n+ this.title = $('h2');\n+ this.subtitle = $('h3');\n+ this.buttons = $$('section.buttons button.btn');\n+ this.field = $('input[name=\"foo\"]');\n+\n+ this.title_field = $('input#field-title');\n+ this.title_label = $('label[for=\"field-title\"]');\n+ this.title_postfix = $('span#field-title_postfix');\n+\n+ }\n+}\n+\n+module.exports = KitchensinkPage;\n\\ No newline at end of file\n" } ]
PHP
MIT License
bolt/core
Adding some e2e tests
95,144
26.01.2019 18:42:32
-3,600
55230b4fd4815d8f22a9aae79a540b7675f0cabc
Working on "Preview" and "View Saved"
[ { "change_type": "MODIFY", "old_path": "src/Controller/Backend/ContentEditController.php", "new_path": "src/Controller/Backend/ContentEditController.php", "diff": "@@ -13,6 +13,7 @@ use Bolt\\Entity\\Taxonomy;\nuse Bolt\\Enum\\Statuses;\nuse Bolt\\EventListener\\ContentFillListener;\nuse Bolt\\Repository\\TaxonomyRepository;\n+use Bolt\\TemplateChooser;\nuse Carbon\\Carbon;\nuse Doctrine\\Common\\Persistence\\ObjectManager;\nuse Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Security;\n@@ -32,27 +33,28 @@ use Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface;\n*/\nclass ContentEditController extends BaseController\n{\n- /**\n- * @var TaxonomyRepository\n- */\n+ /** @var TaxonomyRepository */\nprivate $taxonomyRepository;\n- /**\n- * @var ObjectManager\n- */\n+ /** @var ObjectManager */\nprivate $em;\n- /**\n- * @var UrlGeneratorInterface\n- */\n+ /** @var UrlGeneratorInterface */\nprivate $urlGenerator;\n- public function __construct(TaxonomyRepository $taxonomyRepository, Config $config, CsrfTokenManagerInterface $csrfTokenManager, ObjectManager $em, UrlGeneratorInterface $urlGenerator)\n+ public function __construct(\n+ TaxonomyRepository $taxonomyRepository,\n+ Config $config,\n+ CsrfTokenManagerInterface $csrfTokenManager,\n+ ObjectManager $em,\n+ UrlGeneratorInterface $urlGenerator,\n+ TemplateChooser $templateChooser)\n{\n$this->taxonomyRepository = $taxonomyRepository;\n$this->em = $em;\n$this->urlGenerator = $urlGenerator;\nparent::__construct($config, $csrfTokenManager);\n+ $this->templateChooser = $templateChooser;\n}\n/**\n@@ -87,11 +89,7 @@ class ContentEditController extends BaseController\n*/\npublic function editPost(Request $request, ?Content $content = null): Response\n{\n- $token = new CsrfToken('editrecord', $request->request->get('_csrf_token'));\n-\n- if (! $this->csrfTokenManager->isTokenValid($token)) {\n- throw new InvalidCsrfTokenException();\n- }\n+ $this->validateToken($request);\n$content = $this->contentFromPost($content, $request);\n@@ -109,6 +107,52 @@ class ContentEditController extends BaseController\nreturn new RedirectResponse($url);\n}\n+ /**\n+ * @Route(\"/viewsaved/{id}\", name=\"bolt_content_edit_viewsave\", methods={\"POST\"})\n+ */\n+ public function editViewSaved(Request $request, UrlGeneratorInterface $urlGenerator, ?Content $content = null): Response\n+ {\n+ $this->validateToken($request);\n+\n+ $urlParams = [\n+ 'slugOrId' => $content->getId(),\n+ 'contentTypeSlug' => $content->getDefinition()->get('slug'),\n+ ];\n+\n+ $url = $urlGenerator->generate('record', $urlParams);\n+\n+ return new RedirectResponse($url);\n+ }\n+\n+ /**\n+ * @Route(\"/preview/{id}\", name=\"bolt_content_edit_preview\", methods={\"POST\"})\n+ */\n+ public function editPreview(Request $request, ?Content $content = null): Response\n+ {\n+ $this->validateToken($request);\n+\n+ $content = $this->contentFromPost($request, $content);\n+ $recordSlug = $content->getDefinition()->get('singular_slug');\n+\n+ $context = [\n+ 'record' => $content,\n+ $recordSlug => $content,\n+ ];\n+\n+ $templates = $this->templateChooser->record($content);\n+\n+ return $this->renderTemplate($templates, $context);\n+ }\n+\n+ private function validateToken(Request $request): void\n+ {\n+ $token = new CsrfToken('editrecord', $request->request->get('_csrf_token'));\n+\n+ if (! $this->csrfTokenManager->isTokenValid($token)) {\n+ throw new InvalidCsrfTokenException();\n+ }\n+ }\n+\nprivate function contentFromPost(?Content $content, Request $request): Content\n{\n$formData = $request->request->all();\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Frontend/DetailController.php", "new_path": "src/Controller/Frontend/DetailController.php", "diff": "@@ -54,7 +54,7 @@ class DetailController extends BaseController\nthrow new NotFoundHttpException('Content is not published');\n}\n- $recordSlug = $record->getDefinition()['singular_slug'];\n+ $recordSlug = $record->getDefinition()->get('singular_slug');\n$context = [\n'record' => $record,\n" }, { "change_type": "ADD", "old_path": null, "new_path": "templates/content/_buttons.html.twig", "diff": "+{% import '@bolt/_macro/_macro.html.twig' as macro %}\n+\n+{{ macro.button('action.save', 'fa-save', 'success', 'submit', 'editcontent') }}\n+\n+{% if record.id %}\n+<div class=\"btn-group\">\n+ <button type=\"submit\" class=\"btn btn-secondary mb-3\" form=\"editcontent\"\n+ formaction=\"{{ path('bolt_content_edit_preview', {'id': record.id }) }}\" formtarget=\"_blank\">\n+ <i class=\"fas fa-external-link-square-alt mr-2\"></i>\n+ {{ 'action.preview'|trans }}\n+ </button>\n+\n+ <button type=\"button\" class=\"btn btn-secondary dropdown-toggle dropdown-toggle-split mb-3\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n+ <span class=\"sr-only\">Toggle Dropdown</span>\n+ </button>\n+ <button type=\"submit\" class=\"btn btn-light dropdown-menu dropdown-menu-right\" form=\"editcontent\"\n+ formaction=\"{{ path('bolt_content_edit_viewsave', {'id': record.id }) }}\" formtarget=\"_blank\" style=\"white-space: nowrap; padding-right: 1rem;\">\n+ <i class=\"fas fa-external-link-square-alt mr-2 ml-2\"></i>\n+ {{ 'action.view_saved'|trans }}\n+ </button>\n+</div>\n+{% endif %}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "templates/content/edit.html.twig", "new_path": "templates/content/edit.html.twig", "diff": "</div>\n- {{ macro.button('action.save', 'fa-save', 'success') }}\n+ {% include '@bolt/content/_buttons.html.twig' %}\n</form>\n<div class=\"card mb-3\">\n<div class=\"card-body\">\n- {{ macro.button('action.save', 'fa-save', 'success', 'submit', 'editcontent') }}\n+ {% include '@bolt/content/_buttons.html.twig' %}\n</div>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "translations/messages.en.xlf", "new_path": "translations/messages.en.xlf", "diff": "<target>Permalink</target>\n</segment>\n</unit>\n+ <unit id=\"dQIY7_J\" name=\"action.preview\">\n+ <segment>\n+ <source>action.preview</source>\n+ <target>Preview</target>\n+ </segment>\n+ </unit>\n+ <unit id=\"ok6YulQ\" name=\"action.view_saved\">\n+ <segment>\n+ <source>action.view_saved</source>\n+ <target>View (saved version) on site</target>\n+ </segment>\n+ </unit>\n</file>\n</xliff>\n" } ]
PHP
MIT License
bolt/core
Working on "Preview" and "View Saved"
95,144
26.01.2019 14:24:07
-3,600
901289e1619da114d2830c1e5efc269cbea61aa9
Update NL file
[ { "change_type": "MODIFY", "old_path": "config/packages/translation.yaml", "new_path": "config/packages/translation.yaml", "diff": "@@ -10,6 +10,8 @@ translation:\nedit_in_place:\nenabled: false\nconfig_name: app\n+ auto_add_missing_translations:\n+ config_name: 'app'\nconfigs:\napp:\ndirs: [\"%kernel.project_dir%/templates\", \"%kernel.project_dir%/src\"]\n" }, { "change_type": "MODIFY", "old_path": "translations/messages.nl.xlf", "new_path": "translations/messages.nl.xlf", "diff": "<tool tool-id=\"symfony\" tool-name=\"Symfony\"/>\n</header>\n<body>\n- <trans-unit id=\"80JoLd0\" resname=\"title.login\">\n- <source>title.login</source>\n- <target>__title.login</target>\n- <note priority=\"1\">templates/security/login.twig:4</note>\n- </trans-unit>\n<trans-unit id=\"LDhDPrF\" resname=\"label.username\">\n<source>label.username</source>\n<target>Gebruikersnaam</target>\n<target>Log in</target>\n<note priority=\"1\">templates/security/login.twig:84</note>\n</trans-unit>\n- <trans-unit id=\"vJwSCBO\" resname=\"title.contentlisting\">\n- <source>title.contentlisting</source>\n- <target>__title.contentlisting</target>\n- <note priority=\"1\">templates/content/listing.twig:9</note>\n- </trans-unit>\n- <trans-unit id=\"wtG.cxy\" resname=\"info.change_password\">\n- <source>info.change_password</source>\n- <target>__info.change_password</target>\n- <note priority=\"1\">templates/users/change_password.twig:12</note>\n- </trans-unit>\n<trans-unit id=\"HLtdhYw\" resname=\"action.save\">\n<source>action.save</source>\n<target>Wijzigingen opslaan</target>\n<target>Gedepubliceerd op</target>\n<note priority=\"1\">templates/editcontent/edit.twig:110</note>\n</trans-unit>\n- <trans-unit id=\"VKhfRZB\" resname=\"field.title\">\n- <source>field.title</source>\n- <target>__field.title</target>\n- <note priority=\"1\">templates/editcontent/media_edit.twig:47</note>\n- </trans-unit>\n- <trans-unit id=\"7_wwX8J\" resname=\"field.description\">\n- <source>field.description</source>\n- <target>__field.description</target>\n- <note priority=\"1\">templates/editcontent/media_edit.twig:53</note>\n- </trans-unit>\n<trans-unit id=\"hjDmcPC\" resname=\"field.copyright\">\n<source>field.copyright</source>\n<target>Copyright</target>\n<note priority=\"1\">templates/editcontent/media_edit.twig:59</note>\n</trans-unit>\n- <trans-unit id=\"v0sitU8\" resname=\"field.originalFilename\">\n- <source>field.originalFilename</source>\n- <target>__field.originalFilename</target>\n- <note priority=\"1\">templates/editcontent/media_edit.twig:66</note>\n- </trans-unit>\n- <trans-unit id=\"vlRe8Tx\" resname=\"field.width\">\n- <source>field.width</source>\n- <target>__field.width</target>\n- <note priority=\"1\">templates/editcontent/media_edit.twig:105</note>\n- </trans-unit>\n- <trans-unit id=\"CZbXbM_\" resname=\"field.height\">\n- <source>field.height</source>\n- <target>__field.height</target>\n- <note priority=\"1\">templates/editcontent/media_edit.twig:112</note>\n- </trans-unit>\n- <trans-unit id=\"Sz_u.OS\" resname=\"field.filesize\">\n- <source>field.filesize</source>\n- <target>__field.filesize</target>\n- <note priority=\"1\">templates/editcontent/media_edit.twig:119</note>\n- </trans-unit>\n- <trans-unit id=\"DF34uM2\" resname=\"http_error.name\">\n- <source>http_error.name</source>\n- <target>__http_error.name</target>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error.html.twig:15</note>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error404.html.twig:15</note>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error500.html.twig:15</note>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error403.html.twig:15</note>\n- </trans-unit>\n- <trans-unit id=\"e3w.2Rf\" resname=\"http_error.description\">\n- <source>http_error.description</source>\n- <target>__http_error.description</target>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error.html.twig:18</note>\n- </trans-unit>\n- <trans-unit id=\"ru5FEGk\" resname=\"http_error.suggestion\">\n- <source>http_error.suggestion</source>\n- <target>__http_error.suggestion</target>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error.html.twig:21</note>\n- </trans-unit>\n- <trans-unit id=\"_W1eNz2\" resname=\"http_error_404.description\">\n- <source>http_error_404.description</source>\n- <target>__http_error_404.description</target>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error404.html.twig:18</note>\n- </trans-unit>\n- <trans-unit id=\"MWNS5dg\" resname=\"http_error_404.suggestion\">\n- <source>http_error_404.suggestion</source>\n- <target>__http_error_404.suggestion</target>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error404.html.twig:21</note>\n- </trans-unit>\n- <trans-unit id=\"ZYXSW95\" resname=\"http_error_500.description\">\n- <source>http_error_500.description</source>\n- <target>__http_error_500.description</target>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error500.html.twig:18</note>\n- </trans-unit>\n- <trans-unit id=\"VVs_J1c\" resname=\"http_error_500.suggestion\">\n- <source>http_error_500.suggestion</source>\n- <target>__http_error_500.suggestion</target>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error500.html.twig:21</note>\n- </trans-unit>\n- <trans-unit id=\"Qn5rwdU\" resname=\"http_error_403.description\">\n- <source>http_error_403.description</source>\n- <target>__http_error_403.description</target>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error403.html.twig:18</note>\n- </trans-unit>\n- <trans-unit id=\"zDeeh7L\" resname=\"http_error_403.suggestion\">\n- <source>http_error_403.suggestion</source>\n- <target>__http_error_403.suggestion</target>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error403.html.twig:21</note>\n- </trans-unit>\n- <trans-unit id=\"VgeTgE2\" resname=\"help.show_code\">\n- <source>help.show_code</source>\n- <target>__help.show_code</target>\n- <note priority=\"1\">templates/debug/source_code.twig:3</note>\n- </trans-unit>\n<trans-unit id=\"QbohvW1\" resname=\"action.show_code\">\n<source>action.show_code</source>\n<target>Toon broncode</target>\n<note priority=\"1\">templates/debug/source_code.twig:7</note>\n</trans-unit>\n- <trans-unit id=\"9RwuNlf\" resname=\"title.source_code\">\n- <source>title.source_code</source>\n- <target>__title.source_code</target>\n- <note priority=\"1\">templates/debug/source_code.twig:17</note>\n- </trans-unit>\n- <trans-unit id=\"jaB3QjG\" resname=\"title.controller_code\">\n- <source>title.controller_code</source>\n- <target>__title.controller_code</target>\n- <note priority=\"1\">templates/debug/source_code.twig:22</note>\n- <note priority=\"1\">templates/debug/source_code.twig:25</note>\n- </trans-unit>\n- <trans-unit id=\"tbB2gib\" resname=\"not_available\">\n- <source>not_available</source>\n- <target>__not_available</target>\n- <note priority=\"1\">templates/debug/source_code.twig:26</note>\n- </trans-unit>\n- <trans-unit id=\"2bH7SjO\" resname=\"title.twig_template_code\">\n- <source>title.twig_template_code</source>\n- <target>__title.twig_template_code</target>\n- <note priority=\"1\">templates/debug/source_code.twig:29</note>\n- </trans-unit>\n- <trans-unit id=\"RMPnq6o\" resname=\"label.username_or_email\">\n- <source>label.username_or_email</source>\n- <target>__label.username_or_email</target>\n- <note priority=\"1\">templates/security/login.twig:61</note>\n- </trans-unit>\n- <trans-unit id=\"IaF1MjB\" resname=\"label.rememberme\">\n- <source>label.rememberme</source>\n- <target>__label.rememberme</target>\n- <note priority=\"1\">templates/security/login.twig:80</note>\n- </trans-unit>\n<trans-unit id=\"k.JymqB\" resname=\"about.visit_bolt\">\n<source>about.visit_bolt</source>\n<target>Bezoek Bolt.cm</target>\n<target>Bolt documentatie</target>\n<note priority=\"1\">templates/pages/about.twig:28</note>\n</trans-unit>\n- <trans-unit id=\"FO7zDub\" resname=\"about.bolt_on_github\">\n- <source>about.bolt_on_github</source>\n- <target>__about.bolt_on_github</target>\n- <note priority=\"1\">templates/pages/about.twig:31</note>\n- </trans-unit>\n<trans-unit id=\"_9fS00R\" resname=\"about.used_libraries\">\n<source>about.used_libraries</source>\n<target>Gebruikte Libraries / Componenten</target>\n<note priority=\"1\">templates/pages/about.twig:35</note>\n</trans-unit>\n- <trans-unit id=\"tgLgLDQ\" resname=\"about.list_of_used_libraries\">\n- <source>about.list_of_used_libraries</source>\n- <target>about.list_of_used_libraries</target>\n- <note priority=\"1\">templates/pages/about.twig:37</note>\n- </trans-unit>\n<trans-unit id=\"aYnbvsn\" resname=\"label.fullname\">\n<source>label.fullname</source>\n<target>Volledige naam</target>\n<note priority=\"1\">src/Form/UserType.php:38</note>\n<note priority=\"1\">new</note>\n</trans-unit>\n- <trans-unit id=\"pGkejkU\" resname=\"label.current_password\">\n- <source>label.current_password</source>\n- <target></target>\n- <note priority=\"1\">src/Form/ChangePasswordType.php:24</note>\n- <note priority=\"1\">new</note>\n- </trans-unit>\n- <trans-unit id=\"iiWFLaI\" resname=\"label.new_password\">\n- <source>label.new_password</source>\n- <target></target>\n- <note priority=\"1\">src/Form/ChangePasswordType.php:42</note>\n- <note priority=\"1\">new</note>\n- </trans-unit>\n- <trans-unit id=\"Ucl9Jfc\" resname=\"label.new_password_confirm\">\n- <source>label.new_password_confirm</source>\n- <target></target>\n- <note priority=\"1\">src/Form/ChangePasswordType.php:45</note>\n- <note priority=\"1\">new</note>\n- </trans-unit>\n- <trans-unit id=\"XCmpWav\" resname=\"newPassword\">\n- <source>newPassword</source>\n- <target></target>\n- <note priority=\"1\">src/Form/ChangePasswordType.php:23</note>\n- <note priority=\"1\">new</note>\n- </trans-unit>\n- <trans-unit id=\"47DEQpj\" resname=\"\">\n- <source></source>\n- <target></target>\n- </trans-unit>\n- <trans-unit id=\"OBmPOoB\" resname=\"user.updated_successfully\">\n- <source>user.updated_successfully</source>\n- <target></target>\n- <note priority=\"1\">src/Controller/Backend/UserController.php:33</note>\n- <note priority=\"1\">new</note>\n- </trans-unit>\n- <trans-unit id=\"3hkt.eH\" resname=\"content.updated_successfully\">\n- <source>content.updated_successfully</source>\n- <target></target>\n- <note priority=\"1\">src/Controller/Backend/EditMediaController.php:126</note>\n- <note priority=\"1\">src/Controller/Backend/EditRecordController.php:86</note>\n- <note priority=\"1\">new</note>\n- </trans-unit>\n- <trans-unit id=\"IB0mNQh\" resname=\"content.created_successfully\">\n- <source>content.created_successfully</source>\n- <target></target>\n- <note priority=\"1\">src/Controller/Backend/EditMediaController.php:157</note>\n- <note priority=\"1\">new</note>\n- </trans-unit>\n- <trans-unit id=\"Iyry5.g\" resname=\"editfile.updated_successfully\">\n- <source>editfile.updated_successfully</source>\n- <target></target>\n- <note priority=\"1\">src/Controller/Backend/EditFileController.php:99</note>\n- <note priority=\"1\">new</note>\n- </trans-unit>\n- <trans-unit id=\"b1jqjUC\" resname=\"editfile.could_not_write\">\n- <source>editfile.could_not_write</source>\n- <target></target>\n- <note priority=\"1\">src/Controller/Backend/EditFileController.php:101</note>\n- <note priority=\"1\">new</note>\n- </trans-unit>\n<trans-unit id=\"Oiwdkpg\" resname=\"The Default theme\">\n<source>The Default theme</source>\n<target>Het standaard thema</target>\n<source>field.locale</source>\n<target>Locale</target>\n</trans-unit>\n- <trans-unit id=\"y5otxEK\" resname=\"caption.filename\">\n- <source>caption.filename</source>\n- <target>__caption.filename</target>\n- </trans-unit>\n<trans-unit id=\"8zEzq8N\" resname=\"field.current_locale\">\n<source>field.current_locale</source>\n<target>Huidige locale</target>\n" } ]
PHP
MIT License
bolt/core
Update NL file
95,144
26.01.2019 16:18:23
-3,600
a3f58ebd52b47ea7eca6cb6dd5056bb35b10f41a
Updating translation.yaml
[ { "change_type": "DELETE", "old_path": "config/packages/php_translation_loco_adapter.yaml", "new_path": null, "diff": "-translation_adapter_loco:\n- index_parameter: 'id' # 'text' or 'name'. Leave blank for \"auto\" See https://localise.biz/api/docs/export/exportlocale\n- projects:\n- my_project:\n- api_key: '%env(LOCO_PROJECT_API_KEY)%'\n- domains: ['messages']\n" }, { "change_type": "MODIFY", "old_path": "config/packages/translation.yaml", "new_path": "config/packages/translation.yaml", "diff": "@@ -10,11 +10,18 @@ translation:\nedit_in_place:\nenabled: false\nconfig_name: app\n- auto_add_missing_translations:\n- config_name: 'app'\nconfigs:\napp:\ndirs: [\"%kernel.project_dir%/templates\", \"%kernel.project_dir%/src\"]\noutput_dir: \"%kernel.project_dir%/translations\"\nexcluded_names: [\"*TestCase.php\", \"*Test.php\"]\nexcluded_dirs: [cache, data, logs]\n+ remote_storage: [\"php_translation.adapter.loco\"]\n+\n+# php_translation_adapter_loco_adapter\n+translation_adapter_loco:\n+ index_parameter: 'id' # 'text' or 'name'. Leave blank for \"auto\" See https://localise.biz/api/docs/export/exportlocale\n+ projects:\n+ my_project:\n+ api_key: '%env(LOCO_PROJECT_API_KEY)%'\n+ domains: ['messages']\n" }, { "change_type": "MODIFY", "old_path": "translations/messages.en.xlf", "new_path": "translations/messages.en.xlf", "diff": "</unit>\n<unit id=\"DF34uM2\" name=\"http_error.name\">\n<notes>\n- <note priority=\"1\">templates/bundles/TwigBundle/Exception/error.html.twig:15</note>\n<note>templates/bundles/TwigBundle/Exception/error.html.twig:15</note>\n<note>templates/bundles/TwigBundle/Exception/error404.html.twig:15</note>\n<note>templates/bundles/TwigBundle/Exception/error500.html.twig:15</note>\n" } ]
PHP
MIT License
bolt/core
Updating translation.yaml
95,144
26.01.2019 18:58:19
-3,600
ed79065486ec92383f6b0f02532ef395d829e7a7
Fixing up Kakunin test. (removing duplicate)
[ { "change_type": "MODIFY", "old_path": "tests/e2e/features/edit_record.feature", "new_path": "tests/e2e/features/edit_record.feature", "diff": "@@ -16,7 +16,6 @@ Feature: Edit record\n| id | 5 |\nThen there is element \"title\" with text \"Changed title\"\n- @wip\nScenario: As an Admin I want to change title of a record in another language\nGiven I am logged in as \"admin\"\n@@ -56,10 +55,6 @@ Feature: Edit record\n| _locale | nl |\nThen there is element \"title\" with text \"Changed title NL\"\n- When I visit the \"single_record\" page with parameters:\n- | id | 1 |\n- Then there is element \"title\" with text \"Changed title NL\"\n-\nWhen I visit the \"single_record\" page with parameters:\n| id | 1 |\n| _locale | en |\n" } ]
PHP
MIT License
bolt/core
Fixing up Kakunin test. (removing duplicate)
95,144
01.02.2019 14:39:52
-3,600
94e10bc42a3306cf13271ddab39ed78b4e59173b
Add reference to the instructions for translations.
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -6,7 +6,7 @@ Bolt 4.0.0 prototype\n> **Rebuild and start again**\n> Obliterate what makes us weak\n--- Hatebreed - [Destroy Everything](https://www.youtube.com/watch?v=DBwgX8yBqsw)\n+-- Hatebreed - [Destroy Everything][hatebreed]\nProgress towards alpha / beta\n-----------------------------\n@@ -49,7 +49,8 @@ make docker-db-create\nActually, just add `docker-` prefix to any Make command and that's it!\n-In your browser, go to http://0.0.0.0:8088/ for the frontend, and to http://0.0.0.0:8088/bolt for the Admin Panel.\n+In your browser, go to `http://0.0.0.0:8088/` for the frontend, and to\n+`http://0.0.0.0:8088/bolt` for the Admin Panel.\nSet up Database\n---------------\n@@ -130,7 +131,7 @@ vendor/bin/phpstan.bat analyse -c phpstan.neon src\nTesting\n---\n-Bolt uses several testing frameworks for [different test layers](https://martinfowler.com/articles/practical-test-pyramid.html):\n+Bolt uses several testing frameworks for [different test layers][fowler]:\n- unit: PHPSpec, PHPUnit, Jest\n- integration (of Symfony services): PHPUnit with KernelTestCase\n- functional (API Contracts): Behat\n@@ -151,3 +152,15 @@ To run E2E tests:\nmake e2e\n```\n+\n+Translations\n+------------\n+\n+These are the translations used in Bolt. We rely on the community to expand on new\n+translations, and keep them up to date. If you wish to participate, read the\n+[instructions here][translations].\n+\n+\n+[fowler]: https://martinfowler.com/articles/practical-test-pyramid.html\n+[translations]: https://github.com/bolt/four/wiki/Contribute-on-translations\n+[hatebreed]: https://www.youtube.com/watch?v=DBwgX8yBqsw\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "templates/bundles/TranslationBundle/WebUI/base.html.twig", "new_path": "templates/bundles/TranslationBundle/WebUI/base.html.twig", "diff": "{% block main %}\n+{% if not app.request.get('configName') %}\n+ <p>These are the translations used in Bolt. We rely on the community to expand on new\n+ translations, and keep them up to date. If you wish to participate, read the\n+ <a href=\"https://github.com/bolt/four/wiki/Contribute-on-translations\">instructions here</a>.\n+ </p>\n+{% endif %}\n+\n<nav class=\"navbar navbar-expand-lg navbar-light bg-light\">\n<div class=\"container\">\n<ul class=\"navbar-nav mr-auto\">\n" } ]
PHP
MIT License
bolt/core
Add reference to the instructions for translations.
95,144
01.02.2019 14:50:33
-3,600
dcd23675b5aa41c21251a8b61d604dcfc3da7ec6
Restoring missing part of test.
[ { "change_type": "MODIFY", "old_path": "config/packages/translation.yaml", "new_path": "config/packages/translation.yaml", "diff": "@@ -14,6 +14,4 @@ translation:\napp:\ndirs: [\"%kernel.project_dir%/templates\", \"%kernel.project_dir%/src\"]\noutput_dir: \"%kernel.project_dir%/translations\"\n- excluded_names: [\"*TestCase.php\", \"*Test.php\"]\n- excluded_dirs: [cache, data, logs]\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/features/edit_record.feature", "new_path": "tests/e2e/features/edit_record.feature", "diff": "@@ -55,6 +55,10 @@ Feature: Edit record\n| _locale | nl |\nThen there is element \"title\" with text \"Changed title NL\"\n+ When I visit the \"single_record\" page with parameters:\n+ | id | 1 |\n+ Then there is element \"title\" with text \"Changed title NL\"\n+\nWhen I visit the \"single_record\" page with parameters:\n| id | 1 |\n| _locale | en |\n" } ]
PHP
MIT License
bolt/core
Restoring missing part of test.
95,144
01.02.2019 14:51:34
-3,600
9e0fe5da03f41384098ce6384b61d58f4a3e2482
Remove unneeded excludes
[ { "change_type": "MODIFY", "old_path": "config/packages/dev/translation.yaml", "new_path": "config/packages/dev/translation.yaml", "diff": "@@ -14,8 +14,6 @@ translation:\napp:\ndirs: [\"%kernel.project_dir%/templates\", \"%kernel.project_dir%/src\"]\noutput_dir: \"%kernel.project_dir%/translations\"\n- excluded_names: [\"*TestCase.php\", \"*Test.php\"]\n- excluded_dirs: [cache, data, logs]\nremote_storage: [\"php_translation.adapter.loco\"]\n# php_translation_adapter_loco_adapter\n" } ]
PHP
MIT License
bolt/core
Remove unneeded excludes
95,144
02.02.2019 16:34:16
-3,600
fe114cafbd02719710f1844202411fedd9d09b79
Consistently use the '@bolt' namespace in templates
[ { "change_type": "MODIFY", "old_path": "src/Controller/Backend/AuthenticationController.php", "new_path": "src/Controller/Backend/AuthenticationController.php", "diff": "@@ -29,7 +29,7 @@ class AuthenticationController extends BaseController\n// last authentication error (if any)\n$error = $authenticationUtils->getLastAuthenticationError();\n- return $this->renderTemplate('security/login.html.twig', [\n+ return $this->renderTemplate('@bolt/security/login.html.twig', [\n'last_username' => $last_username,\n'error' => $error,\n]);\n@@ -58,6 +58,6 @@ class AuthenticationController extends BaseController\n'subtitle' => 'To reset your password, if you\\'ve misplaced it',\n];\n- return $this->renderTemplate('pages/placeholder.html.twig', $twigVars);\n+ return $this->renderTemplate('@bolt/pages/placeholder.html.twig', $twigVars);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/ContentEditController.php", "new_path": "src/Controller/Backend/ContentEditController.php", "diff": "@@ -81,7 +81,7 @@ class ContentEditController extends BaseController\n'currentlocale' => $this->getEditLocale($request, $content),\n];\n- return $this->renderTemplate('content/edit.html.twig', $twigvars);\n+ return $this->renderTemplate('@bolt/content/edit.html.twig', $twigvars);\n}\n/**\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/ContentOverviewController.php", "new_path": "src/Controller/Backend/ContentOverviewController.php", "diff": "@@ -34,7 +34,7 @@ class ContentOverviewController extends BaseController\n$records = $contentRepository->findForPage($page, $contentType);\n- return $this->renderTemplate('content/listing.html.twig', [\n+ return $this->renderTemplate('@bolt/content/listing.html.twig', [\n'records' => $records,\n'contentType' => $contentType,\n]);\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/DashboardController.php", "new_path": "src/Controller/Backend/DashboardController.php", "diff": "@@ -30,7 +30,7 @@ class DashboardController extends BaseController\n/** @var Content $records */\n$records = $content->findLatest();\n- return $this->renderTemplate('dashboard/dashboard.html.twig', [\n+ return $this->renderTemplate('@bolt/dashboard/dashboard.html.twig', [\n'records' => $records,\n]);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/DatabaseIntegrityController.php", "new_path": "src/Controller/Backend/DatabaseIntegrityController.php", "diff": "@@ -26,7 +26,7 @@ class DatabaseIntegrityController extends BaseController\n'subtitle' => 'To check the Database',\n];\n- return $this->renderTemplate('pages/placeholder.html.twig', $twigVars);\n+ return $this->renderTemplate('@bolt/pages/placeholder.html.twig', $twigVars);\n}\n/**\n@@ -39,6 +39,6 @@ class DatabaseIntegrityController extends BaseController\n'subtitle' => 'To update the Database',\n];\n- return $this->renderTemplate('pages/placeholder.html.twig', $twigVars);\n+ return $this->renderTemplate('@bolt/pages/placeholder.html.twig', $twigVars);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/EditMediaController.php", "new_path": "src/Controller/Backend/EditMediaController.php", "diff": "@@ -73,7 +73,7 @@ class EditMediaController extends BaseController\n'media' => $media,\n];\n- return $this->renderTemplate('editcontent/media_edit.html.twig', $context);\n+ return $this->renderTemplate('@bolt/editcontent/media_edit.html.twig', $context);\n}\n/**\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/FileEditController.php", "new_path": "src/Controller/Backend/FileEditController.php", "diff": "@@ -47,7 +47,7 @@ class FileEditController extends BaseController\n'contents' => $contents,\n];\n- return $this->renderTemplate('finder/editfile.html.twig', $context);\n+ return $this->renderTemplate('@bolt/finder/editfile.html.twig', $context);\n}\n/**\n@@ -82,7 +82,7 @@ class FileEditController extends BaseController\n'contents' => $contents,\n];\n- return $this->renderTemplate('finder/editfile.html.twig', $context);\n+ return $this->renderTemplate('@bolt/finder/editfile.html.twig', $context);\n}\n$basepath = $this->config->getPath($area);\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/FixturesController.php", "new_path": "src/Controller/Backend/FixturesController.php", "diff": "@@ -26,6 +26,6 @@ class FixturesController extends BaseController\n'subtitle' => 'To add Fixtures, or \"Dummy Content\".',\n];\n- return $this->renderTemplate('pages/placeholder.html.twig', $twigVars);\n+ return $this->renderTemplate('@bolt/pages/placeholder.html.twig', $twigVars);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/GeneralController.php", "new_path": "src/Controller/Backend/GeneralController.php", "diff": "@@ -25,7 +25,7 @@ class GeneralController extends BaseController\n*/\npublic function about(): Response\n{\n- return $this->renderTemplate('pages/about.html.twig');\n+ return $this->renderTemplate('@bolt/pages/about.html.twig');\n}\n/**\n@@ -47,6 +47,6 @@ class GeneralController extends BaseController\n'subtitle' => 'To show a number of different things, on one page',\n];\n- return $this->renderTemplate('pages/placeholder.html.twig', $twigVars);\n+ return $this->renderTemplate('@bolt/pages/placeholder.html.twig', $twigVars);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/MediaController.php", "new_path": "src/Controller/Backend/MediaController.php", "diff": "@@ -61,7 +61,7 @@ class MediaController extends BaseController\n$this->manager->flush();\n}\n- return $this->renderTemplate('finder/finder.twig', [\n+ return $this->renderTemplate('@bolt/finder/finder.twig', [\n'path' => 'path',\n'name' => $this->areas->get($area, 'name'),\n'area' => $area,\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/OmnisearchController.php", "new_path": "src/Controller/Backend/OmnisearchController.php", "diff": "@@ -26,6 +26,6 @@ class OmnisearchController extends BaseController\n'subtitle' => 'To search, in an omni-like fashion',\n];\n- return $this->renderTemplate('pages/placeholder.html.twig', $twigVars);\n+ return $this->renderTemplate('@bolt/pages/placeholder.html.twig', $twigVars);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/ProfileController.php", "new_path": "src/Controller/Backend/ProfileController.php", "diff": "@@ -33,7 +33,7 @@ class ProfileController extends BaseController\n{\n$user = $this->getUser();\n- return $this->renderTemplate('users/edit.html.twig', [\n+ return $this->renderTemplate('@bolt/users/edit.html.twig', [\n'display_name' => $user->getDisplayName(),\n'user' => $user,\n]);\n@@ -90,7 +90,7 @@ class ProfileController extends BaseController\n}\nif ($hasError) {\n- return $this->renderTemplate('users/edit.html.twig', [\n+ return $this->renderTemplate('@bolt/users/edit.html.twig', [\n'display_name' => $displayName,\n'user' => $user,\n]);\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/UserController.php", "new_path": "src/Controller/Backend/UserController.php", "diff": "@@ -26,6 +26,6 @@ class UserController extends BaseController\n'subtitle' => 'To edit users and their permissions',\n];\n- return $this->renderTemplate('pages/placeholder.html.twig', $twigVars);\n+ return $this->renderTemplate('@bolt/pages/placeholder.html.twig', $twigVars);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "templates/_base/layout.html.twig", "new_path": "templates/_base/layout.html.twig", "diff": "{% endblock %}\n</aside>\n<div class=\"admin__notifications\">\n- {{ include('_partials/_flash_messages.html.twig') }}\n+ {{ include('@bolt/_partials/_flash_messages.html.twig') }}\n</div>\n</div>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/_base.html.twig", "new_path": "templates/_partials/fields/_base.html.twig", "diff": "{{ prefix|raw }}\n{% block label %}\n- {% include '_partials/fields/_label.html.twig' %}\n+ {% include '@bolt/_partials/fields/_label.html.twig' %}\n{% endblock %}\n{% block field %}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_fields.html.twig", "new_path": "templates/content/_fields.html.twig", "diff": "{% endif %}\n{% include [\n- '_partials/fields/' ~ fielddefinition.type ~ '.html.twig',\n- '_partials/fields/generic.html.twig'\n+ '@bolt/_partials/fields/' ~ fielddefinition.type ~ '.html.twig',\n+ '@bolt/_partials/fields/generic.html.twig'\n] with { 'field' : field } %}\n{% endfor %}\n" } ]
PHP
MIT License
bolt/core
Consistently use the '@bolt' namespace in templates
95,144
02.02.2019 16:44:46
-3,600
8f1f55be214156bee4ea0ece8ae41dda9c15c365
Code Style fixes for index.php
[ { "change_type": "MODIFY", "old_path": "public/index.php", "new_path": "public/index.php", "diff": "<?php\n+declare(strict_types=1);\n+\nuse Bolt\\Kernel;\nuse Symfony\\Component\\Debug\\Debug;\nuse Symfony\\Component\\Dotenv\\Dotenv;\n@@ -16,7 +18,7 @@ if (!isset($_SERVER['APP_ENV'])) {\n}\n$env = $_SERVER['APP_ENV'] ?? 'dev';\n-$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env));\n+$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ($env !== 'prod'));\nif ($debug) {\numask(0000);\n@@ -24,12 +26,12 @@ if ($debug) {\nDebug::enable();\n}\n-if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {\n- Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);\n+if (! empty($_SERVER['TRUSTED_PROXIES'])) {\n+ Request::setTrustedProxies(explode(',', $_SERVER['TRUSTED_PROXIES']), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);\n}\n-if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {\n- Request::setTrustedHosts(explode(',', $trustedHosts));\n+if (! empty($_SERVER['TRUSTED_HOSTS'])) {\n+ Request::setTrustedHosts(explode(',', $_SERVER['TRUSTED_HOSTS']));\n}\n$kernel = new Kernel($env, $debug);\n" } ]
PHP
MIT License
bolt/core
Code Style fixes for index.php
95,144
04.02.2019 09:16:18
-3,600
cef3659bcd7741c91f03f85e8ba3ee145056bd87
Fix "Unused binding" breakage introduced in SF 4.2.3
[ { "change_type": "MODIFY", "old_path": "config/services.yaml", "new_path": "config/services.yaml", "diff": "@@ -19,7 +19,8 @@ services:\n# The best practice is to be explicit about your dependencies anyway.\nbind: # defines the scalar arguments once and apply them to any service defined/created in this file\n$locales: '%app_locales%'\n- $defaultLocale: '%locale%'\n+ # @todo: This breaks, starting with SF 4.2.3. Check if needed, and if so, fix properly.\n+ # $defaultLocale: '%locale%'\n$emailSender: '%app.notifications.email_sender%'\n$projectDir: '%kernel.project_dir%'\n" }, { "change_type": "MODIFY", "old_path": "symfony.lock", "new_path": "symfony.lock", "diff": "\"symplify/token-runner\": {\n\"version\": \"v5.2.3\"\n},\n- \"thecodingmachine/safe\": {\n- \"version\": \"v0.1.8\"\n- },\n\"theseer/tokenizer\": {\n\"version\": \"1.1.0\"\n},\n" } ]
PHP
MIT License
bolt/core
Fix "Unused binding" breakage introduced in SF 4.2.3
95,144
04.02.2019 12:09:33
-3,600
9d6d075b0877c6211f62c418fd606d0ec195a9b6
Update services.yaml, remove unneeded bind
[ { "change_type": "MODIFY", "old_path": "config/services.yaml", "new_path": "config/services.yaml", "diff": "@@ -19,8 +19,6 @@ services:\n# The best practice is to be explicit about your dependencies anyway.\nbind: # defines the scalar arguments once and apply them to any service defined/created in this file\n$locales: '%app_locales%'\n- # @todo: This breaks, starting with SF 4.2.3. Check if needed, and if so, fix properly.\n- # $defaultLocale: '%locale%'\n$emailSender: '%app.notifications.email_sender%'\n$projectDir: '%kernel.project_dir%'\n" } ]
PHP
MIT License
bolt/core
Update services.yaml, remove unneeded bind
95,144
04.02.2019 12:21:14
-3,600
4006521bcf0798c1a14d1701639c2fbc409607e7
Add missing `register-service-worker`
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"moment\": \"^2.24.0\",\n\"no-scroll\": \"^2.1.1\",\n\"popper.js\": \"^1.14.7\",\n+ \"register-service-worker\": \"^1.5.2\",\n\"simplemde\": \"^1.11.2\",\n\"stylelint-config-recommended-scss\": \"^3.2.0\",\n\"stylelint-scss\": \"^3.5.1\",\n" } ]
PHP
MIT License
bolt/core
Add missing `register-service-worker`
95,144
04.02.2019 12:31:26
-3,600
a198e97c9f5c1cf89a39a0fa9a2af1249b621e3a
No `^`, fix on 3.14.1
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"simplemde\": \"^1.11.2\",\n\"stylelint-config-recommended-scss\": \"^3.2.0\",\n\"stylelint-scss\": \"^3.5.1\",\n- \"terser\": \"^3.14.1\",\n+ \"terser\": \"3.14.1\",\n\"tinycolor2\": \"^1.4.1\",\n\"vue\": \"^2.5.22\",\n\"vue-flatpickr-component\": \"^8.1.1\",\n" } ]
PHP
MIT License
bolt/core
No `^`, fix on 3.14.1
95,132
31.01.2019 14:59:50
-3,600
539f8fecfde4387420567d7ceb83ba376f418b37
Start with `Embed` field
[ { "change_type": "MODIFY", "old_path": "assets/js/app/editor/Components/Editor/index.js", "new_path": "assets/js/app/editor/Components/Editor/index.js", "diff": "@@ -10,7 +10,8 @@ import Number from './Number/Number';\nimport Html from './Html/Html';\nimport Markdown from './Markdown/Markdown';\nimport Textarea from './Textarea/Textarea';\n+import Embed from './Embed/Embed';\nimport Image from './Image/Image';\n-export { Text, Slug, Number, Date, Select, Html, Markdown, Textarea, Image };\n+export { Text, Slug, Number, Date, Select, Html, Markdown, Textarea, Embed, Image };\n" }, { "change_type": "MODIFY", "old_path": "assets/js/app/editor/index.js", "new_path": "assets/js/app/editor/index.js", "diff": "@@ -7,15 +7,16 @@ import store from './store';\n* Components\n*/\nimport {\n- Text,\n- Slug,\n- Number,\nDate,\n- Select,\n+ Embed,\nHtml,\n+ Image,\nMarkdown,\n+ Number,\n+ Select,\n+ Slug,\n+ Text,\nTextarea,\n- Image,\n} from './Components/Editor';\nimport { Language } from './Components/General';\n@@ -25,15 +26,16 @@ new Vue({\nel: '#editor',\nname: 'BoltEditor',\ncomponents: {\n- 'general-language': Language,\n- 'editor-text': Text,\n- 'editor-slug': Slug,\n- 'editor-number': Number,\n- 'editor-date': Date,\n- 'editor-select': Select,\n- 'editor-html': Html,\n- 'editor-markdown': Markdown,\n- 'editor-textarea': Textarea,\n- 'editor-image': Image,\n- },\n+ \"editor-date\": Date,\n+ \"editor-embed\": Embed,\n+ \"editor-html\": Html,\n+ \"editor-image\": Image,\n+ \"editor-markdown\": Markdown,\n+ \"editor-number\": Number,\n+ \"editor-select\": Select,\n+ \"editor-slug\": Slug,\n+ \"editor-text\": Text,\n+ \"editor-textarea\": Textarea,\n+ \"general-language\": Language,\n+ }\n});\n" } ]
PHP
MIT License
bolt/core
Start with `Embed` field
95,132
01.02.2019 11:15:47
-3,600
c117dd5c7722669e81bfc935309e4abbd91ba66a
Implement the basics of the Embed field (Vue) The `|e('js')` is needed when there's HTML or quotes in the value. Otherwise, this will break the whole application (blank admin area).
[ { "change_type": "ADD", "old_path": null, "new_path": "src/Controller/Async/Embed.php", "diff": "+<?php\n+\n+declare(strict_types=1);\n+\n+namespace Bolt\\Controller\\Async;\n+\n+use Symfony\\Component\\HttpFoundation\\JsonResponse;\n+use Symfony\\Component\\HttpFoundation\\Request;\n+use Symfony\\Component\\HttpFoundation\\Response;\n+use Symfony\\Component\\Routing\\Annotation\\Route;\n+\n+/**\n+ * Async controller for embed routes.\n+ */\n+final class Embed\n+{\n+ /**\n+ * @Route(\"/embed\", name=\"bolt_embed\")\n+ */\n+ public function embed(Request $request): JsonResponse\n+ {\n+ try {\n+ $url = $request->query->get('url');\n+ $info = \\Embed\\Embed::create($url);\n+\n+ $providers = $info->getProviders();\n+ $oembed = $providers['oembed'];\n+\n+ return new JsonResponse(\n+ $oembed->getBag()->getAll()\n+ );\n+ } catch (\\Embed\\Exceptions\\InvalidUrlException $e) {\n+ $response = [\n+ 'error' => [\n+ 'message' => $e->getMessage()\n+ ]\n+ ];\n+ return new JsonResponse($response, Response::HTTP_SERVICE_UNAVAILABLE);\n+ }\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/fields/embed.html.twig", "new_path": "templates/_partials/fields/embed.html.twig", "diff": "{% block field %}\n<editor-embed\n+ :embedapi=\"'{{ path('bolt_embed') }}'\"\n:name=\"'{{ name }}'\"\n:url=\"'{{ field.get('url') }}'\"\n:width=\"'{{ field.get('width') }}'\"\n:height=\"'{{ field.get('height') }}'\"\n- :title=\"'{{ field.get('title') }}'\"\n- :authorname=\"'{{ field.get('authorname') }}'\"\n- :author_url=\"'{{ field.get('author_url') }}'\"\n+ :title=\"'{{ field.get('title')|e('js') }}'\"\n+ :authorname=\"'{{ field.get('authorname')|e('js') }}'\"\n+ :authorurl=\"'{{ field.get('authorurl') }}'\"\n:html=\"'{{ field.get('html') }}'\"\n:thumbnail=\"'{{ field.get('thumbnail') }}'\"\n></editor-embed>\n" } ]
PHP
MIT License
bolt/core
Implement the basics of the Embed field (Vue) The `|e('js')` is needed when there's HTML or quotes in the value. Otherwise, this will break the whole application (blank admin area).
95,132
01.02.2019 13:27:51
-3,600
3777cbe94ceb5c995ee5545ae7f2dddff190102a
Add `embed/embed`
[ { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"doctrine/doctrine-migrations-bundle\": \"^1.3\",\n\"doctrine/orm\": \"^2.5.11\",\n\"easycorp/easy-log-handler\": \"^1.0.7\",\n+ \"embed/embed\": \"^3.3\",\n\"erusev/parsedown\": \"^1.7\",\n\"ezyang/htmlpurifier\": \"^4.10\",\n\"fzaninotto/faker\": \"^1.8\",\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Async/Embed.php", "new_path": "src/Controller/Async/Embed.php", "diff": "@@ -32,8 +32,8 @@ final class Embed\n} catch (\\Embed\\Exceptions\\InvalidUrlException $e) {\n$response = [\n'error' => [\n- 'message' => $e->getMessage()\n- ]\n+ 'message' => $e->getMessage(),\n+ ],\n];\nreturn new JsonResponse($response, Response::HTTP_SERVICE_UNAVAILABLE);\n}\n" } ]
PHP
MIT License
bolt/core
Add `embed/embed`
95,132
01.02.2019 14:25:22
-3,600
059ace670a05612189caf55cd6c3556f2a383385
Add CSRF check and allow POST-only method on `/embed`
[ { "change_type": "MODIFY", "old_path": "assets/js/app/editor/Components/Editor/Embed/Embed.vue", "new_path": "assets/js/app/editor/Components/Editor/Embed/Embed.vue", "diff": "@@ -96,7 +96,11 @@ export default {\n},\nmethods: {\nfetchEmbed: function() {\n- fetch(this.embedapi + '?url=' + this.url)\n+ const body = new FormData();\n+ body.append('url', this.url);\n+ body.append( '_csrf_token', document.getElementsByName('_csrf_token')[0].value)\n+\n+ fetch(this.embedapi, { method: 'POST', body: body })\n.then(response => response.json())\n.then(json => {\nthis.authorurl = json.author_url;\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Async/Embed.php", "new_path": "src/Controller/Async/Embed.php", "diff": "@@ -8,19 +8,40 @@ use Symfony\\Component\\HttpFoundation\\JsonResponse;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Component\\Routing\\Annotation\\Route;\n+use Symfony\\Component\\Security\\Core\\Exception\\InvalidCsrfTokenException;\n+use Symfony\\Component\\Security\\Csrf\\CsrfToken;\n+use Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface;\n/**\n* Async controller for embed routes.\n*/\nfinal class Embed\n{\n+ /** @var CsrfTokenManagerInterface */\n+ private $csrfTokenManager;\n+\n+ public function __construct(CsrfTokenManagerInterface $csrfTokenManager)\n+ {\n+ $this->csrfTokenManager = $csrfTokenManager;\n+ }\n+\n/**\n- * @Route(\"/embed\", name=\"bolt_embed\")\n+ * @Route(\n+ * \"/embed\",\n+ * name=\"bolt_embed\",\n+ * methods={\"POST\"})\n*/\npublic function embed(Request $request): JsonResponse\n{\n+ $csrfToken = $request->request->get('_csrf_token');\n+ $token = new CsrfToken('editrecord', $csrfToken);\n+\n+ if (! $this->csrfTokenManager->isTokenValid($token)) {\n+ throw new InvalidCsrfTokenException();\n+ }\n+\ntry {\n- $url = $request->query->get('url');\n+ $url = $request->request->get('url');\n$info = \\Embed\\Embed::create($url);\n$providers = $info->getProviders();\n" } ]
PHP
MIT License
bolt/core
Add CSRF check and allow POST-only method on `/embed`
95,132
01.02.2019 14:52:41
-3,600
fb627e64a685278a05ad83c472efb14c693e1ab2
Return response instead of throwing error
[ { "change_type": "MODIFY", "old_path": "src/Controller/Async/Embed.php", "new_path": "src/Controller/Async/Embed.php", "diff": "@@ -37,7 +37,7 @@ final class Embed\n$token = new CsrfToken('editrecord', $csrfToken);\nif (! $this->csrfTokenManager->isTokenValid($token)) {\n- throw new InvalidCsrfTokenException();\n+ return new JsonResponse(['error' => ['message' => 'Invalid CSRF token']], Response::HTTP_FORBIDDEN);\n}\ntry {\n@@ -51,12 +51,7 @@ final class Embed\n$oembed->getBag()->getAll()\n);\n} catch (\\Embed\\Exceptions\\InvalidUrlException $e) {\n- $response = [\n- 'error' => [\n- 'message' => $e->getMessage(),\n- ],\n- ];\n- return new JsonResponse($response, Response::HTTP_SERVICE_UNAVAILABLE);\n+ return new JsonResponse(['error' => ['message' => $e->getMessage()]], Response::HTTP_SERVICE_UNAVAILABLE);\n}\n}\n}\n" } ]
PHP
MIT License
bolt/core
Return response instead of throwing error
95,132
01.02.2019 16:10:53
-3,600
edf18f6c5ffde84f34dcb291d99a182b0ba081bb
Import `Embed\Embed` I need a new name, because `Embed` is also the name of the class
[ { "change_type": "MODIFY", "old_path": "src/Controller/Async/Embed.php", "new_path": "src/Controller/Async/Embed.php", "diff": "@@ -4,6 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\Controller\\Async;\n+use Embed\\Embed as EmbedService;\nuse Embed\\Exceptions\\InvalidUrlException;\nuse Symfony\\Component\\HttpFoundation\\JsonResponse;\nuse Symfony\\Component\\HttpFoundation\\Request;\n@@ -42,7 +43,7 @@ final class Embed\ntry {\n$url = $request->request->get('url');\n- $info = \\Embed\\Embed::create($url);\n+ $info = EmbedService::create($url);\n$oembed = $info->getProviders()['oembed'];\nreturn new JsonResponse(\n" } ]
PHP
MIT License
bolt/core
Import `Embed\Embed` I need a new name, because `Embed` is also the name of the class
95,132
01.02.2019 16:49:10
-3,600
86248321c2de9e25de638b95cfae3a41d3d6ea68
Return 400 Bad Request in case of invalid URL
[ { "change_type": "MODIFY", "old_path": "src/Controller/Async/Embed.php", "new_path": "src/Controller/Async/Embed.php", "diff": "@@ -50,7 +50,7 @@ final class Embed\n$oembed->getBag()->getAll()\n);\n} catch (InvalidUrlException $e) {\n- return new JsonResponse(['error' => ['message' => $e->getMessage()]], Response::HTTP_SERVICE_UNAVAILABLE);\n+ return new JsonResponse(['error' => ['message' => $e->getMessage()]], Response::HTTP_BAD_REQUEST);\n}\n}\n}\n" } ]
PHP
MIT License
bolt/core
Return 400 Bad Request in case of invalid URL
95,132
04.02.2019 14:33:01
-3,600
f39bb492c7fc937e4f8d9841cbbcfd275742a7d2
Add Kakunin tests
[ { "change_type": "MODIFY", "old_path": "tests/e2e/features/edit_record.feature", "new_path": "tests/e2e/features/edit_record.feature", "diff": "@@ -67,3 +67,17 @@ Feature: Edit record\nWhen I visit the \"single_record\" page with parameters:\n| id | 1 |\nThen there is element \"title\" with text \"Changed title EN\"\n+\n+ @wip\n+ Scenario: As an Admin I want to be able to make use of the embed field\n+ Given I am logged in as \"admin\"\n+\n+ When I visit the \"edit_record\" page with parameters:\n+ | id | 32 |\n+ Then I wait for \"title_field\" element to appear\n+ When I fill the \"embed_field\" field with \"https://www.youtube.com/watch?v=x4IDM3ltTYo\"\n+ And I wait for \"2\" seconds\n+ Then there is element \"embed_title\" with text \"Silversun Pickups - Nightlight (Official Video)\"\n+ And there is element \"embed_author\" with text \"Silversun Pickups\"\n+ And there is element \"embed_width\" with text \"480\"\n+ And there is element \"embed_height\" with text \"270\"\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/pages/edit_record.js", "new_path": "tests/e2e/pages/edit_record.js", "diff": "@@ -14,6 +14,12 @@ class EditRecordPage extends BasePage {\nthis.lang_select = $('#metadata > form > div:nth-child(2) > div > div > div > div.multiselect__select');\nthis.lang_nl = $('#metadata > form > div:nth-child(2) > div > div > div > div.multiselect__content-wrapper > ul > li:nth-child(2) > span');\n+ this.embed_field = $('[name=\"fields[embed][url]\"]');\n+ this.embed_width = $('[name=\"fields[embed][width]\"]');\n+ this.embed_height = $('[name=\"fields[embed][height]\"]');\n+ this.embed_title = $('[name=\"fields[embed][title]\"]');\n+ this.embed_author = $('[name=\"fields[embed][authorname]\"]');\n+\nthis.save_button = $('button[type=\"submit\"]');\n}\n}\n" } ]
PHP
MIT License
bolt/core
Add Kakunin tests
95,132
04.02.2019 16:39:09
-3,600
4c9bf6cd9b44d78cf62b0897e2408eb12b1cc0b7
Fix tabbar The correct ordering is: ``` [role=tablist] > li.nav-item > a.nav-link ``` See:
[ { "change_type": "MODIFY", "old_path": "assets/scss/modules/editor/_tabbar.scss", "new_path": "assets/scss/modules/editor/_tabbar.scss", "diff": ".nav-item {\ncolor: var(--shade);\nposition: relative;\n+ }\n+\n+ .nav-link {\n+ padding: $spacer / 2 $spacer / 1.5;\n&::after {\ntransition: $transition-base;\nfont-weight: $font-weight-semibold;\n}\n- &.active,\n- &.show {\n+ &.active {\n&::after {\ntransform: scaleX(1);\n}\n}\n}\n}\n-\n- .nav-link {\n- padding: $spacer / 2 $spacer / 1.5;\n- }\n}\n" }, { "change_type": "MODIFY", "old_path": "templates/content/_tabs.html.twig", "new_path": "templates/content/_tabs.html.twig", "diff": "<ul class=\"nav editor__tabbar\" role=\"tablist\">\n{% for group in groups %}\n<li class=\"nav-item\">\n- <a class=\"nav-item nav-link {% if loop.first %}active{% endif %}\" id=\"{{group|slug}}-tab\" data-toggle=\"pill\" href=\"#{{group|slug}}\" role=\"tab\" aria-controls=\"{{group|slug}}\" aria-selected=\"{% if loop.first %}true{%else%}false{% endif %}\">\n+ <a class=\"nav-link {% if loop.first %}active{% endif %}\" id=\"{{group|slug}}-tab\" data-toggle=\"pill\" href=\"#{{group|slug}}\" role=\"tab\" aria-controls=\"{{group|slug}}\" aria-selected=\"{% if loop.first %}true{%else%}false{% endif %}\">\n<span>{{group|capitalize}}</span></a>\n</li>\n{% endfor %}\n" } ]
PHP
MIT License
bolt/core
Fix tabbar The correct ordering is: ``` [role=tablist] > li.nav-item > a.nav-link ``` See: https://getbootstrap.com/docs/4.0/components/navs/#javascript-behavior
95,144
04.02.2019 17:37:35
-3,600
01cc54784f1fd4dfe234559177afe069b3ef1818
Update Font Awesome to 5.7.1
[ { "change_type": "MODIFY", "old_path": "templates/_base/layout.html.twig", "new_path": "templates/_base/layout.html.twig", "diff": "<title>{{ block('title')|striptags }}</title>\n{% block stylesheets %}\n<link href=\"https://fonts.googleapis.com/css?family=Open+Sans:400,600|Source+Sans+Pro:300,400,600&amp;subset=latin-ext\" rel=\"stylesheet\">\n- <link rel=\"stylesheet\" href=\"https://use.fontawesome.com/releases/v5.6.3/css/all.css\" integrity=\"sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/\" crossorigin=\"anonymous\">\n+ <link rel=\"stylesheet\" href=\"https://use.fontawesome.com/releases/v5.7.1/css/all.css\" integrity=\"sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr\" crossorigin=\"anonymous\">\n{% set theme = 'theme-' ~ user.backendTheme|default('default') %}\n{{ encore_entry_link_tags('bolt') }}\n{{ encore_entry_link_tags(theme) }}\n" } ]
PHP
MIT License
bolt/core
Update Font Awesome to 5.7.1
95,144
05.02.2019 17:58:06
-3,600
09a9f3f2835bbad9f4559d1fe2ea9cf64c7c922d
Updating About page
[ { "change_type": "MODIFY", "old_path": "templates/pages/about.html.twig", "new_path": "templates/pages/about.html.twig", "diff": "developers and content-editors. Bolt is Open Source, and as such it uses other Open Source\ncomponents. If you are a developer you're very welcome to help in the further development of Bolt.\n</p>\n+ <p>The ongoing Bolt development is spearheaded by:</p>\n+ <ul>\n+ <li><a href=\"https://twokings.nl/\">Two Kings</a> &ndash; Artisinal Web Development</li>\n+ <li><a href=\"https://tsh.io/\">The Software House</a> &ndash; Web and Mobile Development</li>\n+ </ul>\n<p>\nAll parts of Bolt are free to use under the open-source MIT license. The full licensing text can be\nfound here, in the included <a href=\"https://docs.bolt.cm/other/license\">LICENSE.md</a>.\n<a href=\"https://docs.bolt.cm\" class=\"btn btn-secondary\" target=\"_blank\">\n<i class=\"fa fa-book\"></i> {{ 'about.bolt_documentation'|trans }}\n</a>\n- <a href=\"https://github.com/bolt/docs\" class=\"btn btn-secondary\" target=\"_blank\">\n+ <a href=\"https://github.com/bolt\" class=\"btn btn-secondary\" target=\"_blank\">\n<i class=\"fab fa-github-alt\"></i> {{ 'about.bolt_on_github'|trans }}\n</a>\n</p>\n<p>{{ 'about.list_of_used_libraries'|trans }}{# #}</p>\n<ul>\n- <li>The awesome <a href=\"https://symfony.com/4\">Symfony 4, PHP framework</a> and a lot of the\n- <a href=\"http://symfony.com/\">Symfony components</a>.</li>\n- <li>The <a href=\"http://www.doctrine-project.org\">Doctrine ORM and DBAL</a> for database access, abstraction and object mapping.</li>\n- <li><a href=\"http://twig.sensiolabs.org/\">Twig, flexible, fast, and secure template engine</a>.</li>\n- <li><a href=\"http://twitter.github.com/bootstrap\">Bootstrap 4</a> and\n- <a href=\"http://fortawesome.github.com/Font-Awesome/\">Font Awesome</a></li>\n- </ul>\n-\n- <ul>\n- <li><a href=\"\">Vue</a> and VueX</li>\n- <li><a href=\"\">CodeMirror</a>.</li>\n- <li><a href=\"\">Webpack</a> and Symfony Encore.</li>\n-\n-\n+ <li>The awesome <a href=\"https://symfony.com/\">Symfony 4, PHP framework</a> and a lot of the\n+ <a href=\"https://symfony.com/\">Symfony components</a>.</li>\n+ <li>The <a href=\"https://www.doctrine-project.org\">Doctrine ORM and DBAL</a> for database access, abstraction and object mapping.</li>\n+ <li><a href=\"https://twig.sensiolabs.org/\">Twig, flexible, fast, and secure template engine</a>.</li>\n+ <li><a href=\"https://getbootstrap.com/\">Bootstrap 4</a> and\n+ <a href=\"https://fontawesome.com/\">Font Awesome</a></li>\n+ <li><a href=\"https://vuejs.org/\">Vue</a> and VueX</li>\n+ <li><a href=\"https://codemirror.net/\">CodeMirror</a>.</li>\n+ <li><a href=\"https://webpack.js.org/\">Webpack</a> and\n+ <a href=\"https://symfony.com/doc/current/frontend/encore/installation.html\">Symfony Encore</a>.</li>\n{# @todo: Once we settle on a Wysiwyg component (like CKeditor), add it here. #}\n{# @todo: Once we settle on a Markdown component (like MDE or ToastUI), add it here. #}\n-\n</ul>\n{% endblock main %}\n" } ]
PHP
MIT License
bolt/core
Updating About page
95,144
05.02.2019 18:40:51
-3,600
b74c18fd1ffa533dc313cc9989c3bcc47313fbb8
Add `tab_media`
[ { "change_type": "MODIFY", "old_path": "tests/e2e/pages/edit_record.js", "new_path": "tests/e2e/pages/edit_record.js", "diff": "@@ -14,6 +14,7 @@ class EditRecordPage extends BasePage {\nthis.lang_select = $('#metadata > form > div:nth-child(2) > div > div > div > div.multiselect__select');\nthis.lang_nl = $('#metadata > form > div:nth-child(2) > div > div > div > div.multiselect__content-wrapper > ul > li:nth-child(2) > span');\n+ this.tab_media = $('#media-tab');\nthis.embed_field = $('[name=\"fields[embed][url]\"]');\nthis.embed_width = $('[name=\"fields[embed][width]\"]');\nthis.embed_height = $('[name=\"fields[embed][height]\"]');\n" } ]
PHP
MIT License
bolt/core
Add `tab_media`
95,144
05.02.2019 18:41:28
-3,600
9a87fcbaa0dfe64c6bae7b1484747555929f0480
Click the `tab_media`
[ { "change_type": "MODIFY", "old_path": "tests/e2e/features/edit_record.feature", "new_path": "tests/e2e/features/edit_record.feature", "diff": "@@ -75,6 +75,7 @@ Feature: Edit record\nWhen I visit the \"edit_record\" page with parameters:\n| id | 32 |\nThen I wait for \"title_field\" element to appear\n+ Then I click the \"tab_media\" element\nWhen I fill the \"embed_field\" field with \"https://www.youtube.com/watch?v=x4IDM3ltTYo\"\nAnd I wait for \"2\" seconds\nThen there is element \"embed_title\" with text \"Silversun Pickups - Nightlight (Official Video)\"\n" } ]
PHP
MIT License
bolt/core
Click the `tab_media`
95,132
11.02.2019 09:59:27
-3,600
84f3877610003f7103727af018b4d385b1b5b0d6
Use `__invoke` instead
[ { "change_type": "MODIFY", "old_path": "src/Controller/Async/Embed.php", "new_path": "src/Controller/Async/Embed.php", "diff": "@@ -33,7 +33,7 @@ final class Embed\n* name=\"bolt_embed\",\n* methods={\"POST\"})\n*/\n- public function embed(Request $request): JsonResponse\n+ public function __invoke(Request $request): JsonResponse\n{\n$csrfToken = $request->request->get('_csrf_token');\n$token = new CsrfToken('editrecord', $csrfToken);\n" } ]
PHP
MIT License
bolt/core
Use `__invoke` instead
95,112
12.02.2019 15:41:44
-3,600
9df9582744a16c3498966cb1fda0e49643be9cfc
Vue fixes and Pagerfanta serialization trick
[ { "change_type": "MODIFY", "old_path": "Makefile", "new_path": "Makefile", "diff": "@@ -107,6 +107,9 @@ docker-start:\ndocker-compose run node sh -c \"npm rebuild node-sass\"\ndocker-compose run node sh -c \"npm run build\"\n+docker-assets-serve:\n+ docker-compose run node sh -c \"npm run serve\"\n+\ndocker-update:\ndocker-compose exec -T php sh -c \"composer update\"\n" }, { "change_type": "MODIFY", "old_path": "assets/js/app/editor/Components/Editor/Image/Image.vue", "new_path": "assets/js/app/editor/Components/Editor/Image/Image.vue", "diff": "@@ -174,7 +174,7 @@ export default {\nthis.progress = 0;\n})\n.catch(err => {\n- console.log(err);\n+ console.warn(err);\nthis.progress = 0;\n});\n},\n" }, { "change_type": "MODIFY", "old_path": "assets/js/app/login/Components/Admin/DashboardContentList.vue", "new_path": "assets/js/app/login/Components/Admin/DashboardContentList.vue", "diff": "@@ -39,13 +39,15 @@ export default {\n};\n},\ncreated() {\n+ // @todo is this ever used?\n+ console.warn('remove above todo');\nthis.records = getRecords(this.type);\nfetchRecords(this.type)\n.then(records => {\nthis.records = records;\n})\n- .catch(error => console.log(error))\n+ .catch(error => console.warn(error))\n.finally(() => {\nthis.loading = false;\n});\n" }, { "change_type": "MODIFY", "old_path": "assets/js/app/login/Components/Admin/DashboardNews.vue", "new_path": "assets/js/app/login/Components/Admin/DashboardNews.vue", "diff": "@@ -29,7 +29,7 @@ export default {\n.then(news => {\nthis.news = news;\n})\n- .catch(error => console.log(error))\n+ .catch(error => console.warn(error))\n.finally(() => {\nthis.loading = false;\n});\n" }, { "change_type": "MODIFY", "old_path": "assets/js/services/api/content.js", "new_path": "assets/js/services/api/content.js", "diff": "@@ -5,6 +5,7 @@ export function getRecords(type) {\n}\nexport function fetchRecords(type) {\n+ // @todo this is probably never used\nreturn axios\n.get(`/api/contents.json?contentType=${type}&pageSize=5`)\n.then(response => {\n" }, { "change_type": "MODIFY", "old_path": "config/bundles.php", "new_path": "config/bundles.php", "diff": "@@ -17,7 +17,7 @@ return [\nSymfony\\Bundle\\SecurityBundle\\SecurityBundle::class => ['all' => true],\nSymfony\\Bundle\\SwiftmailerBundle\\SwiftmailerBundle::class => ['all' => true],\nSymfony\\Bundle\\TwigBundle\\TwigBundle::class => ['all' => true],\n- Symfony\\Bundle\\WebProfilerBundle\\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'local' => true],\n+ Symfony\\Bundle\\WebProfilerBundle\\WebProfilerBundle::class => ['dev' => true, 'local' => true],\nSymfony\\Bundle\\WebServerBundle\\WebServerBundle::class => ['dev' => true, 'test' => true, 'local' => true],\nWhiteOctober\\PagerfantaBundle\\WhiteOctoberPagerfantaBundle::class => ['all' => true],\nKnp\\Bundle\\MenuBundle\\KnpMenuBundle::class => ['all' => true],\n" }, { "change_type": "MODIFY", "old_path": "config/packages/dev/doctrine.yaml", "new_path": "config/packages/dev/doctrine.yaml", "diff": "@@ -9,4 +9,5 @@ doctrine:\n# dbal:\n# driver: 'pdo_mysql'\n# charset: utf8mb4\n+# server_version: 5.6\n# url: 'mysql://%env(DATABASE_USER)%:%env(DATABASE_PASSWORD)%@%env(DATABASE_HOST)%:3306/%env(DATABASE_NAME)%'\n" }, { "change_type": "MODIFY", "old_path": "config/packages/prod/doctrine.yaml", "new_path": "config/packages/prod/doctrine.yaml", "diff": "@@ -2,6 +2,7 @@ doctrine:\ndbal:\ndriver: 'pdo_mysql'\ncharset: utf8mb4\n+ server_version: 5.6\nurl: '%env(DATABASE_URL)%'\norm:\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"scripts\": {\n\"start\": \"encore dev-server --port=8234 --progress --disable-host-check --verbose\",\n\"build\": \"encore production --progress\",\n+ \"serve\": \"encore dev --watch\",\n\"lint\": \"eslint --ext .js,.vue, assets\",\n\"lint-fix\": \"eslint --ext .js,.vue, assets --fix\",\n\"stylelint\": \"stylelint 'assets/scss'\",\n" }, { "change_type": "MODIFY", "old_path": "templates/_partials/_content_listing.html.twig", "new_path": "templates/_partials/_content_listing.html.twig", "diff": "<!-- listing records -->\n<listing-records\ntype=\"{{ type }}\"\n- :data=\"{{ records|json_encode }}\"\n+ {# tricky part: https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle/issues/165#issuecomment-462777227 #}\n+ :data=\"{{ records | merge([]) | json_encode }}\"\n>\n</listing-records>\n<!-- end listing records -->\n" }, { "change_type": "MODIFY", "old_path": "templates/content/listing.html.twig", "new_path": "templates/content/listing.html.twig", "diff": "{% block main %}\n<div>\n- {% include '@bolt/_partials/_content_listing.html.twig' with {'records': records, 'type': 'contentType' } %}\n+ {% include '@bolt/_partials/_content_listing.html.twig' with {'records': records, 'type': contentType.slug } %}\n</div>\n{% endblock %}\n" } ]
PHP
MIT License
bolt/core
Vue fixes and Pagerfanta serialization trick
95,112
12.02.2019 16:50:56
-3,600
aa880abefff53d5b9961068f4f0d030d7c389afc
fix vue listing without an image
[ { "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<!-- column thumbnail -->\n<div\n- v-if=\"size === 'normal'\"\n+ v-if=\"size === 'normal' && record.extras.image !== null\"\nclass=\"listing__row--item is-thumbnail\"\n:style=\"`background-image: url(${record.extras.image.path})`\"\n></div>\n" } ]
PHP
MIT License
bolt/core
fix vue listing without an image
95,112
14.02.2019 13:21:00
-3,600
08b1047ebbc635da91e2985aba7382c1cfc23784
remove dump and add warning
[ { "change_type": "MODIFY", "old_path": "assets/js/services/api/content.js", "new_path": "assets/js/services/api/content.js", "diff": "@@ -6,6 +6,7 @@ export function getRecords(type) {\nexport function fetchRecords(type) {\n// @todo this is probably never used\n+ console.warn('remove above todo');\nreturn axios\n.get(`/api/contents.json?contentType=${type}&pageSize=5`)\n.then(response => {\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Field.php", "new_path": "src/Entity/Field.php", "diff": "@@ -108,7 +108,6 @@ class Field implements Translatable\npublic static function factory(LaravelCollection $definition, string $name = ''): self\n{\n- dd($definition);\n$type = $definition['type'];\n$classname = '\\\\Bolt\\\\Entity\\\\Field\\\\' . ucwords($type) . 'Field';\n" } ]
PHP
MIT License
bolt/core
remove dump and add warning
95,112
14.02.2019 17:41:59
-3,600
636dea14d0968bf9d30533c2d6aac2b5907f4748
fix gitignore test reports
[ { "change_type": "MODIFY", "old_path": ".gitignore", "new_path": ".gitignore", "diff": "@@ -35,9 +35,17 @@ appveyor.yml\n/var/cache/*\n!/var/cache/.gitkeep\n/var/log/*\n-!/var/log/.gitkeep\n+!/var/log/*.gitkeep\n+/var/log/e2e-reports/*\n+!/var/log/e2e-reports/\n+/var/log/e2e-reports/performance/*\n+!/var/log/e2e-reports/performance/\n!/var/log/e2e-reports/performance/.gitkeep\n+/var/log/e2e-reports/report/*\n+!/var/log/e2e-reports/report/\n!/var/log/e2e-reports/report/.gitkeep\n+/var/log/behat-reports/*\n+!/var/log/behat-reports/\n!/var/log/behat-reports/.gitkeep\n/var/data/*\n!/var/data/.gitkeep\n" }, { "change_type": "ADD", "old_path": "var/log/behat-reports/.gitkeep", "new_path": "var/log/behat-reports/.gitkeep", "diff": "" }, { "change_type": "ADD", "old_path": "var/log/e2e-reports/performance/.gitkeep", "new_path": "var/log/e2e-reports/performance/.gitkeep", "diff": "" }, { "change_type": "ADD", "old_path": "var/log/e2e-reports/report/.gitkeep", "new_path": "var/log/e2e-reports/report/.gitkeep", "diff": "" } ]
PHP
MIT License
bolt/core
fix gitignore test reports
95,112
14.02.2019 21:34:32
-3,600
8601a2f02920a21bae980d0b234bd20760f8f253
Move MenuBuilder and Excerpt
[ { "change_type": "MODIFY", "old_path": "src/Entity/Content.php", "new_path": "src/Entity/Content.php", "diff": "@@ -152,7 +152,7 @@ class Content implements \\JsonSerializable\n}\n/**\n- * @see: Bolt\\EventListener\\ContentFillListener\n+ * @see \\Bolt\\EventListener\\ContentFillListener\n*/\npublic function setDefinitionFromContentTypesConfig(LaravelCollection $contentTypesConfig): void\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/ContentExtrasTrait.php", "new_path": "src/Entity/ContentExtrasTrait.php", "diff": "@@ -7,6 +7,9 @@ namespace Bolt\\Entity;\nuse Bolt\\Twig\\ContentExtension;\nuse Symfony\\Component\\Serializer\\Annotation\\Groups;\n+/**\n+ * @see \\Bolt\\Entity\\Content\n+ */\ntrait ContentExtrasTrait\n{\n/**\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/ContentLocalizeTrait.php", "new_path": "src/Entity/ContentLocalizeTrait.php", "diff": "@@ -6,6 +6,9 @@ namespace Bolt\\Entity;\nuse Tightenco\\Collect\\Support\\Collection;\n+/**\n+ * @see \\Bolt\\Entity\\Content\n+ */\ntrait ContentLocalizeTrait\n{\npublic function getLocales(): Collection\n" }, { "change_type": "RENAME", "old_path": "src/Content/MenuBuilder.php", "new_path": "src/Menu/MenuBuilder.php", "diff": "declare(strict_types=1);\n-namespace Bolt\\Content;\n+namespace Bolt\\Menu;\nuse Bolt\\Configuration\\Config;\n+use Bolt\\Content\\ContentType;\nuse Bolt\\Entity\\Content;\nuse Bolt\\Repository\\ContentRepository;\nuse Bolt\\Twig\\ContentExtension;\n@@ -16,7 +17,7 @@ use Symfony\\Contracts\\Translation\\TranslatorInterface;\nclass MenuBuilder\n{\n/** @var FactoryInterface */\n- private $factory;\n+ private $menuFactory;\n/** @var Config */\nprivate $config;\n@@ -33,14 +34,12 @@ class MenuBuilder\n/** @var TranslatorInterface */\nprivate $translator;\n- /**\n- * @var ContentExtension\n- */\n+ /** @var ContentExtension */\nprivate $contentExtension;\n- public function __construct(FactoryInterface $factory, Config $config, Stopwatch $stopwatch, ContentRepository $contentRepository, UrlGeneratorInterface $urlGenerator, TranslatorInterface $translator, ContentExtension $contentExtension)\n+ public function __construct(FactoryInterface $menuFactory, Config $config, Stopwatch $stopwatch, ContentRepository $contentRepository, UrlGeneratorInterface $urlGenerator, TranslatorInterface $translator, ContentExtension $contentExtension)\n{\n- $this->factory = $factory;\n+ $this->menuFactory = $menuFactory;\n$this->config = $config;\n$this->stopwatch = $stopwatch;\n$this->contentRepository = $contentRepository;\n@@ -55,7 +54,7 @@ class MenuBuilder\n$t = $this->translator;\n- $menu = $this->factory->createItem('root');\n+ $menu = $this->menuFactory->createItem('root');\n$menu->addChild('Dashboard', [\n'uri' => $this->urlGenerator->generate('bolt_dashboard'),\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -7,8 +7,8 @@ namespace Bolt\\Twig;\nuse Bolt\\Entity\\Content;\nuse Bolt\\Entity\\Field\\Excerptable;\nuse Bolt\\Entity\\Field\\ImageField;\n-use Bolt\\Helpers\\Excerpt;\nuse Bolt\\Repository\\ContentRepository;\n+use Bolt\\Utils\\Excerpt;\nuse Bolt\\Utils\\Html;\nuse Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface;\nuse Tightenco\\Collect\\Support\\Collection;\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/RecordExtension.php", "new_path": "src/Twig/RecordExtension.php", "diff": "@@ -4,11 +4,11 @@ declare(strict_types=1);\nnamespace Bolt\\Twig;\n-use Bolt\\Content\\MenuBuilder;\nuse Bolt\\Entity\\Content;\nuse Bolt\\Entity\\Field;\n-use Bolt\\Helpers\\Excerpt;\n+use Bolt\\Menu\\MenuBuilder;\nuse Bolt\\Repository\\TaxonomyRepository;\n+use Bolt\\Utils\\Excerpt;\nuse Doctrine\\Common\\Collections\\Collection;\nuse Symfony\\Contracts\\Translation\\TranslatorInterface;\nuse Twig\\Environment;\n" }, { "change_type": "RENAME", "old_path": "src/Helpers/Excerpt.php", "new_path": "src/Utils/Excerpt.php", "diff": "declare(strict_types=1);\n-namespace Bolt\\Helpers;\n-\n-use Bolt\\Utils\\Html;\n+namespace Bolt\\Utils;\nclass Excerpt\n{\n- private function __construct()\n- {\n- }\n-\npublic static function getExcerpt(string $text, int $length = 200, $focus = null): string\n{\nif ($focus) {\n" }, { "change_type": "MODIFY", "old_path": "src/Utils/MomentFormatConverter.php", "new_path": "src/Utils/MomentFormatConverter.php", "diff": "@@ -39,8 +39,8 @@ class MomentFormatConverter\n/**\n* Returns associated moment.js format.\n*/\n- public function convert(string $format): string\n+ public static function convert(string $format): string\n{\n- return strtr($format, self::$formatConvertRules);\n+ return strtr($format, static::$formatConvertRules);\n}\n}\n" } ]
PHP
MIT License
bolt/core
Move MenuBuilder and Excerpt
95,112
12.02.2019 10:50:30
-3,600
e0c8827f790f367553991f205efae18f365d715b
revert symfony.lock
[ { "change_type": "MODIFY", "old_path": "symfony.lock", "new_path": "symfony.lock", "diff": "{\n+ \"api-platform/core\": {\n+ \"version\": \"2.1\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"2.1\",\n+ \"ref\": \"18727d8f229306860b46955f438e1897421da689\"\n+ }\n+ },\n+ \"behat/behat\": {\n+ \"version\": \"v3.5.0\"\n+ },\n+ \"behat/gherkin\": {\n+ \"version\": \"v4.5.1\"\n+ },\n+ \"behat/mink\": {\n+ \"version\": \"1.7.x-dev\"\n+ },\n+ \"behat/mink-browserkit-driver\": {\n+ \"version\": \"1.3.x-dev\"\n+ },\n+ \"behat/mink-extension\": {\n+ \"version\": \"2.3.1\"\n+ },\n+ \"behat/mink-goutte-driver\": {\n+ \"version\": \"v1.2.1\"\n+ },\n+ \"behat/transliterator\": {\n+ \"version\": \"v1.2.0\"\n+ },\n+ \"behatch/contexts\": {\n+ \"version\": \"3.2.0\"\n+ },\n+ \"bolt/common\": {\n+ \"version\": \"v1.1.0\"\n+ },\n+ \"clue/stream-filter\": {\n+ \"version\": \"v1.4.0\"\n+ },\n+ \"cocur/slugify\": {\n+ \"version\": \"v3.1\"\n+ },\n+ \"coduo/php-matcher\": {\n+ \"version\": \"3.1.0\"\n+ },\n+ \"coduo/php-to-string\": {\n+ \"version\": \"2.0.1\"\n+ },\n+ \"composer/ca-bundle\": {\n+ \"version\": \"1.0.8\"\n+ },\n+ \"composer/semver\": {\n+ \"version\": \"1.4.2\"\n+ },\n+ \"composer/xdebug-handler\": {\n+ \"version\": \"1.1.0\"\n+ },\n+ \"container-interop/container-interop\": {\n+ \"version\": \"1.2.0\"\n+ },\n+ \"dama/doctrine-test-bundle\": {\n+ \"version\": \"v4.0.1\"\n+ },\n+ \"doctrine/annotations\": {\n+ \"version\": \"v1.5.0\"\n+ },\n+ \"doctrine/cache\": {\n+ \"version\": \"v1.7.1\"\n+ },\n+ \"doctrine/collections\": {\n+ \"version\": \"v1.5.0\"\n+ },\n+ \"doctrine/common\": {\n+ \"version\": \"v2.8.1\"\n+ },\n+ \"doctrine/data-fixtures\": {\n+ \"version\": \"v1.3.1\"\n+ },\n+ \"doctrine/dbal\": {\n+ \"version\": \"v2.6.2\"\n+ },\n+ \"doctrine/doctrine-bundle\": {\n+ \"version\": \"1.6\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"1.6\",\n+ \"ref\": \"f29d6af1f605b9494a2c9c3a73cb1cacc6cca19b\"\n+ }\n+ },\n+ \"doctrine/doctrine-cache-bundle\": {\n+ \"version\": \"1.3.2\"\n+ },\n+ \"doctrine/doctrine-fixtures-bundle\": {\n+ \"version\": \"3.0\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.0\",\n+ \"ref\": \"2ea6070ecf365f9a801ccaed4b31d4a3b7af5693\"\n+ }\n+ },\n+ \"doctrine/doctrine-migrations-bundle\": {\n+ \"version\": \"1.2\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"1.2\",\n+ \"ref\": \"c1431086fec31f17fbcfe6d6d7e92059458facc1\"\n+ }\n+ },\n+ \"doctrine/event-manager\": {\n+ \"version\": \"v1.0.0\"\n+ },\n+ \"doctrine/inflector\": {\n+ \"version\": \"v1.2.0\"\n+ },\n+ \"doctrine/instantiator\": {\n+ \"version\": \"1.1.0\"\n+ },\n+ \"doctrine/lexer\": {\n+ \"version\": \"v1.0.1\"\n+ },\n+ \"doctrine/migrations\": {\n+ \"version\": \"v1.6.0\"\n+ },\n+ \"doctrine/orm\": {\n+ \"version\": \"v2.5.12\"\n+ },\n+ \"doctrine/persistence\": {\n+ \"version\": \"v1.1.0\"\n+ },\n+ \"doctrine/reflection\": {\n+ \"version\": \"v1.0.0\"\n+ },\n+ \"easycorp/easy-log-handler\": {\n+ \"version\": \"1.0\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"1.0\",\n+ \"ref\": \"70062abc2cd58794d2a90274502f81b55cd9951b\"\n+ }\n+ },\n+ \"egulias/email-validator\": {\n+ \"version\": \"2.1.2\"\n+ },\n+ \"erusev/parsedown\": {\n+ \"version\": \"1.6.3\"\n+ },\n+ \"ezyang/htmlpurifier\": {\n+ \"version\": \"v4.9.3\"\n+ },\n+ \"fabpot/goutte\": {\n+ \"version\": \"v3.2.3\"\n+ },\n\"fig/link-util\": {\n\"version\": \"1.0.0\"\n},\n+ \"friendsofapi/localise.biz\": {\n+ \"version\": \"0.2.4\"\n+ },\n+ \"friendsofphp/php-cs-fixer\": {\n+ \"version\": \"2.2\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"2.2\",\n+ \"ref\": \"9d60c231a92e69c68b89897813ec4931d0697b1f\"\n+ }\n+ },\n+ \"fzaninotto/faker\": {\n+ \"version\": \"v1.8.0\"\n+ },\n+ \"gecko-packages/gecko-php-unit\": {\n+ \"version\": \"v2.2\"\n+ },\n+ \"gedmo/doctrine-extensions\": {\n+ \"version\": \"v2.4.36\"\n+ },\n+ \"guzzlehttp/guzzle\": {\n+ \"version\": \"6.3.3\"\n+ },\n+ \"guzzlehttp/promises\": {\n+ \"version\": \"v1.3.1\"\n+ },\n+ \"guzzlehttp/psr7\": {\n+ \"version\": \"1.4.2\"\n+ },\n+ \"intervention/image\": {\n+ \"version\": \"2.4.2\"\n+ },\n+ \"jdorn/sql-formatter\": {\n+ \"version\": \"v1.2.17\"\n+ },\n+ \"jean85/pretty-package-versions\": {\n+ \"version\": \"1.2\"\n+ },\n+ \"justinrainbow/json-schema\": {\n+ \"version\": \"5.2.8\"\n+ },\n+ \"knplabs/knp-menu\": {\n+ \"version\": \"2.3.0\"\n+ },\n+ \"knplabs/knp-menu-bundle\": {\n+ \"version\": \"v2.2.1\"\n+ },\n+ \"lakion/mink-debug-extension\": {\n+ \"version\": \"v1.2.3\"\n+ },\n+ \"league/flysystem\": {\n+ \"version\": \"1.0.47\"\n+ },\n+ \"league/glide\": {\n+ \"version\": \"1.3.0\"\n+ },\n+ \"league/glide-symfony\": {\n+ \"version\": \"1.0.3\"\n+ },\n+ \"miljar/php-exif\": {\n+ \"version\": \"v0.6.4\"\n+ },\n+ \"monolog/monolog\": {\n+ \"version\": \"1.23.0\"\n+ },\n+ \"myclabs/deep-copy\": {\n+ \"version\": \"1.8.1\"\n+ },\n+ \"nelmio/cors-bundle\": {\n+ \"version\": \"1.5\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"1.5\",\n+ \"ref\": \"1fee84e00c71edee81aa54b470260779a890c9c6\"\n+ }\n+ },\n+ \"nesbot/carbon\": {\n+ \"version\": \"1.34.0\"\n+ },\n+ \"nette/bootstrap\": {\n+ \"version\": \"v2.4.6\"\n+ },\n+ \"nette/di\": {\n+ \"version\": \"v2.4.14\"\n+ },\n+ \"nette/finder\": {\n+ \"version\": \"v2.4.2\"\n+ },\n+ \"nette/neon\": {\n+ \"version\": \"v2.4.3\"\n+ },\n+ \"nette/php-generator\": {\n+ \"version\": \"v3.0.5\"\n+ },\n+ \"nette/robot-loader\": {\n+ \"version\": \"v3.1.0\"\n+ },\n+ \"nette/utils\": {\n+ \"version\": \"v2.5.3\"\n+ },\n+ \"nikic/php-parser\": {\n+ \"version\": \"v4.0.3\"\n+ },\n+ \"nyholm/nsa\": {\n+ \"version\": \"1.1.0\"\n+ },\n+ \"ocramius/package-versions\": {\n+ \"version\": \"1.1.3\"\n+ },\n+ \"ocramius/proxy-manager\": {\n+ \"version\": \"2.1.1\"\n+ },\n+ \"openlss/lib-array2xml\": {\n+ \"version\": \"0.0.10\"\n+ },\n+ \"pagerfanta/pagerfanta\": {\n+ \"version\": \"v1.0.5\"\n+ },\n+ \"paragonie/random_compat\": {\n+ \"version\": \"v2.0.11\"\n+ },\n+ \"phar-io/manifest\": {\n+ \"version\": \"1.0.3\"\n+ },\n+ \"phar-io/version\": {\n+ \"version\": \"2.0.1\"\n+ },\n+ \"php-cs-fixer/diff\": {\n+ \"version\": \"v1.2.0\"\n+ },\n+ \"php-http/cache-plugin\": {\n+ \"version\": \"1.6.0\"\n+ },\n+ \"php-http/client-common\": {\n+ \"version\": \"1.9.0\"\n+ },\n+ \"php-http/curl-client\": {\n+ \"version\": \"v1.7.1\"\n+ },\n+ \"php-http/discovery\": {\n+ \"version\": \"1.6.0\"\n+ },\n+ \"php-http/httplug\": {\n+ \"version\": \"v1.1.0\"\n+ },\n+ \"php-http/httplug-bundle\": {\n+ \"version\": \"1.6\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"1.6\",\n+ \"ref\": \"4655962c64e2de96c418caf576c57215711c7877\"\n+ }\n+ },\n+ \"php-http/httplug-pack\": {\n+ \"version\": \"1.1.0\"\n+ },\n+ \"php-http/logger-plugin\": {\n+ \"version\": \"v1.0.0\"\n+ },\n+ \"php-http/message\": {\n+ \"version\": \"1.7.2\"\n+ },\n+ \"php-http/message-factory\": {\n+ \"version\": \"v1.0.2\"\n+ },\n+ \"php-http/multipart-stream-builder\": {\n+ \"version\": \"1.0.0\"\n+ },\n+ \"php-http/promise\": {\n+ \"version\": \"v1.0.0\"\n+ },\n+ \"php-http/stopwatch-plugin\": {\n+ \"version\": \"1.1.0\"\n+ },\n+ \"php-translation/common\": {\n+ \"version\": \"1.0.0\"\n+ },\n+ \"php-translation/extractor\": {\n+ \"version\": \"1.7.1\"\n+ },\n+ \"php-translation/loco-adapter\": {\n+ \"version\": \"0.8\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes-contrib\",\n+ \"branch\": \"master\",\n+ \"version\": \"0.8\",\n+ \"ref\": \"c97545d1c229338606d881294eceeb4cdc993777\"\n+ }\n+ },\n+ \"php-translation/symfony-bundle\": {\n+ \"version\": \"0.4\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes-contrib\",\n+ \"branch\": \"master\",\n+ \"version\": \"0.4\",\n+ \"ref\": \"ee15ad002114fba7b694a7fe429419b518d43bc4\"\n+ }\n+ },\n+ \"php-translation/symfony-storage\": {\n+ \"version\": \"1.0.1\"\n+ },\n+ \"phpdocumentor/reflection-common\": {\n+ \"version\": \"1.0.1\"\n+ },\n+ \"phpdocumentor/reflection-docblock\": {\n+ \"version\": \"4.3.0\"\n+ },\n+ \"phpdocumentor/type-resolver\": {\n+ \"version\": \"0.4.0\"\n+ },\n+ \"phpspec/php-diff\": {\n+ \"version\": \"v1.1.0\"\n+ },\n+ \"phpspec/phpspec\": {\n+ \"version\": \"5.1.0\"\n+ },\n+ \"phpspec/prophecy\": {\n+ \"version\": \"1.8.0\"\n+ },\n+ \"phpstan/phpdoc-parser\": {\n+ \"version\": \"0.3\"\n+ },\n+ \"phpstan/phpstan\": {\n+ \"version\": \"0.10.3\"\n+ },\n\"phpstan/phpstan-doctrine\": {\n\"version\": \"0.11\"\n},\n\"phpstan/phpstan-symfony\": {\n\"version\": \"0.11\"\n},\n+ \"phpunit/php-code-coverage\": {\n+ \"version\": \"6.1.4\"\n+ },\n+ \"phpunit/php-file-iterator\": {\n+ \"version\": \"2.0.2\"\n+ },\n+ \"phpunit/php-text-template\": {\n+ \"version\": \"1.2.1\"\n+ },\n+ \"phpunit/php-timer\": {\n+ \"version\": \"2.0.0\"\n+ },\n+ \"phpunit/php-token-stream\": {\n+ \"version\": \"3.0.1\"\n+ },\n+ \"phpunit/phpunit\": {\n+ \"version\": \"4.7\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"4.7\",\n+ \"ref\": \"89239f0cf2759efccc76b9944083bfcc4d180f9d\"\n+ }\n+ },\n+ \"psr/cache\": {\n+ \"version\": \"1.0.1\"\n+ },\n+ \"psr/container\": {\n+ \"version\": \"1.0.0\"\n+ },\n+ \"psr/http-message\": {\n+ \"version\": \"1.0.1\"\n+ },\n\"psr/link\": {\n\"version\": \"1.0.0\"\n},\n+ \"psr/log\": {\n+ \"version\": \"1.0.2\"\n+ },\n+ \"psr/simple-cache\": {\n+ \"version\": \"1.0.0\"\n+ },\n+ \"ralouphie/getallheaders\": {\n+ \"version\": \"2.0.5\"\n+ },\n+ \"roave/security-advisories\": {\n+ \"version\": \"dev-master\"\n+ },\n+ \"sebastian/code-unit-reverse-lookup\": {\n+ \"version\": \"1.0.1\"\n+ },\n+ \"sebastian/comparator\": {\n+ \"version\": \"3.0.2\"\n+ },\n+ \"sebastian/diff\": {\n+ \"version\": \"3.0.1\"\n+ },\n+ \"sebastian/environment\": {\n+ \"version\": \"4.0.1\"\n+ },\n+ \"sebastian/exporter\": {\n+ \"version\": \"3.1.0\"\n+ },\n+ \"sebastian/global-state\": {\n+ \"version\": \"2.0.0\"\n+ },\n+ \"sebastian/object-enumerator\": {\n+ \"version\": \"3.0.3\"\n+ },\n+ \"sebastian/object-reflector\": {\n+ \"version\": \"1.1.1\"\n+ },\n+ \"sebastian/recursion-context\": {\n+ \"version\": \"3.0.0\"\n+ },\n+ \"sebastian/resource-operations\": {\n+ \"version\": \"2.0.1\"\n+ },\n+ \"sebastian/version\": {\n+ \"version\": \"2.0.1\"\n+ },\n+ \"seld/jsonlint\": {\n+ \"version\": \"1.7.1\"\n+ },\n+ \"sensio/framework-extra-bundle\": {\n+ \"version\": \"4.0\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"4.0\",\n+ \"ref\": \"aaddfdf43cdecd4cf91f992052d76c2cadc04543\"\n+ }\n+ },\n+ \"sensiolabs/security-checker\": {\n+ \"version\": \"4.0\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"4.0\",\n+ \"ref\": \"576d653444dade07f272c889d52fe4594caa4fc3\"\n+ }\n+ },\n+ \"siriusphp/upload\": {\n+ \"version\": \"2.1.1\"\n+ },\n+ \"siriusphp/validation\": {\n+ \"version\": \"2.2.2\"\n+ },\n+ \"slam/php-cs-fixer-extensions\": {\n+ \"version\": \"v1.17.0\"\n+ },\n+ \"slevomat/coding-standard\": {\n+ \"version\": \"4.8.6\"\n+ },\n+ \"squizlabs/php_codesniffer\": {\n+ \"version\": \"3.0\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes-contrib\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.0\",\n+ \"ref\": \"0dc9cceda799fd3a08b96987e176a261028a3709\"\n+ }\n+ },\n+ \"stof/doctrine-extensions-bundle\": {\n+ \"version\": \"1.2\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes-contrib\",\n+ \"branch\": \"master\",\n+ \"version\": \"1.2\",\n+ \"ref\": \"6c1ceb662f8997085f739cd089bfbef67f245983\"\n+ }\n+ },\n+ \"swiftmailer/swiftmailer\": {\n+ \"version\": \"v6.0.2\"\n+ },\n+ \"symfony/apache-pack\": {\n+ \"version\": \"1.0\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes-contrib\",\n+ \"branch\": \"master\",\n+ \"version\": \"1.0\",\n+ \"ref\": \"c82bead70f9a4f656354a193df7bf0ca2114efa0\"\n+ }\n+ },\n+ \"symfony/asset\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/browser-kit\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/cache\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/class-loader\": {\n+ \"version\": \"v3.4.21\"\n+ },\n+ \"symfony/config\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/console\": {\n+ \"version\": \"3.3\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.3\",\n+ \"ref\": \"5ec5bb098bc693cd92f03390dd488ea0847cfcc7\"\n+ }\n+ },\n+ \"symfony/contracts\": {\n+ \"version\": \"v1.0.0\"\n+ },\n+ \"symfony/css-selector\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/debug\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/debug-bundle\": {\n+ \"version\": \"3.3\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.3\",\n+ \"ref\": \"de31e687f3964939abd1f66817bd96ed34bc2eee\"\n+ }\n+ },\n+ \"symfony/dependency-injection\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/doctrine-bridge\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/dom-crawler\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/dotenv\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/event-dispatcher\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/expression-language\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/filesystem\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/finder\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/flex\": {\n+ \"version\": \"1.0\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"1.0\",\n+ \"ref\": \"e921bdbfe20cdefa3b82f379d1cd36df1bc8d115\"\n+ }\n+ },\n+ \"symfony/form\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/framework-bundle\": {\n+ \"version\": \"3.3\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.3\",\n+ \"ref\": \"bcd70105a1e87e41f31af2ae84aaf948c8bfb189\"\n+ }\n+ },\n+ \"symfony/http-foundation\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/http-kernel\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/inflector\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/intl\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/maker-bundle\": {\n+ \"version\": \"1.0\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"1.0\",\n+ \"ref\": \"fadbfe33303a76e25cb63401050439aa9b1a9c7f\"\n+ }\n+ },\n+ \"symfony/monolog-bridge\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/monolog-bundle\": {\n+ \"version\": \"3.1\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.1\",\n+ \"ref\": \"94d0b0b417e988466de57cea583f83b396e44661\"\n+ }\n+ },\n+ \"symfony/options-resolver\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/phpunit-bridge\": {\n+ \"version\": \"3.3\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.3\",\n+ \"ref\": \"0a66a0097def4db1cd03bcb3d4a268440ae4cb47\"\n+ }\n+ },\n+ \"symfony/polyfill-ctype\": {\n+ \"version\": \"v1.8.0\"\n+ },\n+ \"symfony/polyfill-intl-icu\": {\n+ \"version\": \"v1.6.0\"\n+ },\n+ \"symfony/polyfill-mbstring\": {\n+ \"version\": \"v1.6.0\"\n+ },\n+ \"symfony/polyfill-php70\": {\n+ \"version\": \"v1.6.0\"\n+ },\n+ \"symfony/polyfill-php72\": {\n+ \"version\": \"v1.6.0\"\n+ },\n+ \"symfony/process\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/property-access\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/property-info\": {\n+ \"version\": \"v4.1.4\"\n+ },\n+ \"symfony/routing\": {\n+ \"version\": \"3.3\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.3\",\n+ \"ref\": \"5b2f0ee78c90d671860ac6450e37dec10fbc0719\"\n+ }\n+ },\n+ \"symfony/security-bundle\": {\n+ \"version\": \"3.3\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.3\",\n+ \"ref\": \"85834af1496735f28d831489d12ab1921a875e0d\"\n+ }\n+ },\n+ \"symfony/security-core\": {\n+ \"version\": \"v4.2.0\"\n+ },\n+ \"symfony/security-csrf\": {\n+ \"version\": \"v4.2.0\"\n+ },\n+ \"symfony/security-guard\": {\n+ \"version\": \"v4.2.0\"\n+ },\n+ \"symfony/security-http\": {\n+ \"version\": \"v4.2.0\"\n+ },\n+ \"symfony/serializer\": {\n+ \"version\": \"v4.1.4\"\n+ },\n+ \"symfony/stopwatch\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/swiftmailer-bundle\": {\n+ \"version\": \"2.5\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"2.5\",\n+ \"ref\": \"8daf8ede72274989fb0dc66b83cb4bc1693afbb9\"\n+ }\n+ },\n+ \"symfony/translation\": {\n+ \"version\": \"3.3\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.3\",\n+ \"ref\": \"58f37511a2ceec2761716413ce679cbe118e37c3\"\n+ }\n+ },\n+ \"symfony/twig-bridge\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/twig-bundle\": {\n+ \"version\": \"3.3\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.3\",\n+ \"ref\": \"42324de95dde296ef158f48d6cf7fefddd18da7d\"\n+ }\n+ },\n+ \"symfony/validator\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/var-dumper\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symfony/var-exporter\": {\n+ \"version\": \"v4.2.0\"\n+ },\n\"symfony/web-link\": {\n\"version\": \"v4.2.3\"\n+ },\n+ \"symfony/web-profiler-bundle\": {\n+ \"version\": \"3.3\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.3\",\n+ \"ref\": \"6bdfa1a95f6b2e677ab985cd1af2eae35d62e0f6\"\n+ }\n+ },\n+ \"symfony/web-server-bundle\": {\n+ \"version\": \"3.3\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"3.3\",\n+ \"ref\": \"c72d107d077f1654428edaed69415d0228c1aefe\"\n+ }\n+ },\n+ \"symfony/webpack-encore-bundle\": {\n+ \"version\": \"1.0\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"1.0\",\n+ \"ref\": \"4c97a884bc54a4e66bb2d0785ca855141880b6a8\"\n+ }\n+ },\n+ \"symfony/yaml\": {\n+ \"version\": \"v3.4.0-beta2\"\n+ },\n+ \"symplify/better-phpdoc-parser\": {\n+ \"version\": \"v5.2.3\"\n+ },\n+ \"symplify/coding-standard\": {\n+ \"version\": \"v5.2.3\"\n+ },\n+ \"symplify/easy-coding-standard\": {\n+ \"version\": \"v5.2.3\"\n+ },\n+ \"symplify/package-builder\": {\n+ \"version\": \"v5.2.3\"\n+ },\n+ \"symplify/token-runner\": {\n+ \"version\": \"v5.2.3\"\n+ },\n+ \"theseer/tokenizer\": {\n+ \"version\": \"1.1.0\"\n+ },\n+ \"tightenco/collect\": {\n+ \"version\": \"v5.7.6\"\n+ },\n+ \"twig/extensions\": {\n+ \"version\": \"1.0\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes\",\n+ \"branch\": \"master\",\n+ \"version\": \"1.0\",\n+ \"ref\": \"4851df0afc426b8f07204379d21fca25b6df5d68\"\n+ }\n+ },\n+ \"twig/twig\": {\n+ \"version\": \"v2.4.4\"\n+ },\n+ \"webmozart/assert\": {\n+ \"version\": \"1.3.0\"\n+ },\n+ \"webmozart/path-util\": {\n+ \"version\": \"2.3.0\"\n+ },\n+ \"webonyx/graphql-php\": {\n+ \"version\": \"v0.12.6\"\n+ },\n+ \"white-october/pagerfanta-bundle\": {\n+ \"version\": \"v1.0.8\"\n+ },\n+ \"willdurand/negotiation\": {\n+ \"version\": \"v2.3.1\"\n+ },\n+ \"zendframework/zend-code\": {\n+ \"version\": \"3.3.0\"\n+ },\n+ \"zendframework/zend-eventmanager\": {\n+ \"version\": \"3.2.0\"\n}\n}\n" } ]
PHP
MIT License
bolt/core
revert symfony.lock
95,112
18.02.2019 11:44:16
-3,600
1097dd3f5ccfcdc8b8ba73112e9b8033e3f9058f
npm audit update
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"autoprefixer\": \"^9.4.6\",\n\"babel-core\": \"^7.0.0-bridge.0\",\n\"babel-eslint\": \"^10.0.1\",\n- \"babel-jest\": \"^23.6.0\",\n+ \"babel-jest\": \"^24.1.0\",\n\"eslint\": \"5.12.0\",\n\"eslint-config-prettier\": \"^3.6.0\",\n\"eslint-plugin-prettier\": \"^3.0.1\",\n\"eslint-plugin-standard\": \"^4.0.0\",\n\"eslint-plugin-vue\": \"^5.1.0\",\n- \"jest\": \"^23.6.0\",\n+ \"jest\": \"^24.1.0\",\n\"jest-serializer-vue\": \"^2.0.2\",\n\"node-sass\": \"^4.11.0\",\n\"postcss-loader\": \"^3.0.0\",\n" } ]
PHP
MIT License
bolt/core
npm audit update
95,112
18.02.2019 17:20:53
-3,600
7641d8db7192038024051e522133eeac8907c576
relations: fix tests
[ { "change_type": "MODIFY", "old_path": "Makefile", "new_path": "Makefile", "diff": "@@ -98,16 +98,19 @@ db-reset:\n# Dockerized commands:\ndocker-install:\nmake docker-start\n+ make docker-install-deps\nmake docker-db-create\n-docker-start:\n- cp -n .env.dist .env || true\n- docker-compose up -d\n+docker-install-deps:\ndocker-compose exec -T php sh -c \"composer install\"\ndocker-compose run node sh -c \"npm install\"\ndocker-compose run node sh -c \"npm rebuild node-sass\"\ndocker-compose run node sh -c \"npm run build\"\n+docker-start:\n+ cp -n .env.dist .env || true\n+ docker-compose up -d\n+\ndocker-assets-serve:\ndocker-compose run node sh -c \"npm run serve\"\n" }, { "change_type": "MODIFY", "old_path": "docker-compose.yml", "new_path": "docker-compose.yml", "diff": "@@ -10,7 +10,6 @@ services:\n- .env\ndepends_on:\n- database\n-# - maildev\n- blackfire\nvolumes:\n- ./:/var/www/bolt\n@@ -53,7 +52,7 @@ services:\nimage: phpmyadmin/phpmyadmin\nports:\n- 8099:80\n- external_links:\n+ links:\n- database:db\nblackfire:\n" }, { "change_type": "MODIFY", "old_path": "public/theme/skeleton/partials/_recordfooter.twig", "new_path": "public/theme/skeleton/partials/_recordfooter.twig", "diff": "</p>\n{% endif %}\n- {# @todo See Github Issue https://github.com/bolt/four/issues/252 #}\n- {% set relatedrecords = related_content(record) %}\n- {% if relatedrecords is not empty %}\n+ {% set related_cts = record|related_all %}\n+ {% if related_cts is not empty %}\n<p class=\"meta\">{{ __('general.phrase.related-content') }}\n<ul>\n- {% for related in relatedrecords %}\n+ {% for ct, related_records in related_cts %}\n+ <li>\n+ <h4>Related {{ app.config.contenttypes[ct].name }}</h4>\n+ <ul>\n+ {% for related_record in related_records %}\n<li><a href=\"{{ related|link }}\">{{ related|title }}</a></li>\n{% endfor %}\n</ul>\n+ </li>\n+ {% endfor %}\n+ </ul>\n</p>\n{% endif %}\n{% endif %}\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Content.php", "new_path": "src/Entity/Content.php", "diff": "@@ -442,12 +442,6 @@ class Content implements \\JsonSerializable\nreturn $this;\n}\n- public function related(): array\n- {\n- // @todo See Github issue https://github.com/bolt/four/issues/163\n- return [];\n- }\n-\n/**\n* Generic getter for a record fields. Will return the field with $name.\n*\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Relation.php", "new_path": "src/Entity/Relation.php", "diff": "@@ -61,7 +61,7 @@ class Relation\nprivate $position = 0;\n/**\n- * @ORM\\Column(type=\"string\")\n+ * @ORM\\Column(name=\"`group`\", type=\"string\")\n* @Gedmo\\SortableGroup\n*/\nprivate $group;\n" }, { "change_type": "MODIFY", "old_path": "src/Repository/ContentRepository.php", "new_path": "src/Repository/ContentRepository.php", "diff": "@@ -15,8 +15,8 @@ use Pagerfanta\\Pagerfanta;\nuse Symfony\\Bridge\\Doctrine\\RegistryInterface;\n/**\n- * @method (Content | null) find($id, $lockMode = null, $lockVersion=null)\n- * @method (Content | null) findOneBy(array $criteria, array $orderBy=null)\n+ * @method Content|null find($id, $lockMode = null, $lockVersion = null)\n+ * @method Content|null findOneBy(array $criteria, array $orderBy = null)\n* @method Content[] findAll()\n* @method Content[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)\n*/\n" }, { "change_type": "MODIFY", "old_path": "src/Repository/FieldRepository.php", "new_path": "src/Repository/FieldRepository.php", "diff": "@@ -10,8 +10,8 @@ use Doctrine\\ORM\\QueryBuilder;\nuse Symfony\\Bridge\\Doctrine\\RegistryInterface;\n/**\n- * @method (Field | null) find($id, $lockMode = null, $lockVersion=null)\n- * @method (Field | null) findOneBy(array $criteria, array $orderBy=null)\n+ * @method Field|null find($id, $lockMode = null, $lockVersion = null)\n+ * @method Field|null findOneBy(array $criteria, array $orderBy = null)\n* @method Field[] findAll()\n* @method Field[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)\n*/\n" }, { "change_type": "MODIFY", "old_path": "src/Repository/MediaRepository.php", "new_path": "src/Repository/MediaRepository.php", "diff": "@@ -9,8 +9,8 @@ use Doctrine\\Bundle\\DoctrineBundle\\Repository\\ServiceEntityRepository;\nuse Symfony\\Bridge\\Doctrine\\RegistryInterface;\n/**\n- * @method (Media | null) find($id, $lockMode = null, $lockVersion=null)\n- * @method (Media | null) findOneBy(array $criteria, array $orderBy=null)\n+ * @method Media|null find($id, $lockMode = null, $lockVersion = null)\n+ * @method Media|null findOneBy(array $criteria, array $orderBy = null)\n* @method Media[] findAll()\n* @method Media[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)\n*/\n" }, { "change_type": "MODIFY", "old_path": "src/Repository/RelationRepository.php", "new_path": "src/Repository/RelationRepository.php", "diff": "@@ -12,8 +12,8 @@ use Gedmo\\Sortable\\Entity\\Repository\\SortableRepository;\nuse Symfony\\Bridge\\Doctrine\\RegistryInterface;\n/**\n- * @method (Relation | null) find($id, $lockMode = null, $lockVersion=null)\n- * @method (Relation | null) findOneBy(array $criteria, array $orderBy=null)\n+ * @method Relation|null find($id, $lockMode = null, $lockVersion = null)\n+ * @method Relation|null findOneBy(array $criteria, array $orderBy = null)\n* @method Relation[] findAll()\n* @method Relation[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)\n*/\n@@ -73,7 +73,7 @@ class RelationRepository extends SortableRepository\n->select('r, cfrom, cto')\n->join('r.fromContent', 'cfrom')\n->join('r.toContent', 'cto')\n- ->orderBy('r.sort', 'DESC');\n+ ->orderBy('r.position', 'DESC');\nif ($name !== null) {\n$qb->andWhere('r.name = :name')\n@@ -81,10 +81,11 @@ class RelationRepository extends SortableRepository\n}\nif ($reversed === false) {\n- $qb->andWhere('cfrom.id', $from->getId(), \\PDO::PARAM_INT);\n+ $qb->andWhere('r.fromContent = :from');\n} else {\n- $qb->andWhere('cto.id', $from->getId(), \\PDO::PARAM_INT);\n+ $qb->andWhere('r.toContent = :from');\n}\n+ $qb->setParameter(':from', $from);\nreturn $qb;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Repository/TaxonomyRepository.php", "new_path": "src/Repository/TaxonomyRepository.php", "diff": "@@ -9,8 +9,8 @@ use Doctrine\\Bundle\\DoctrineBundle\\Repository\\ServiceEntityRepository;\nuse Symfony\\Bridge\\Doctrine\\RegistryInterface;\n/**\n- * @method (Taxonomy | null) find($id, $lockMode = null, $lockVersion=null)\n- * @method (Taxonomy | null) findOneBy(array $criteria, array $orderBy=null)\n+ * @method Taxonomy|null find($id, $lockMode = null, $lockVersion = null)\n+ * @method Taxonomy|null findOneBy(array $criteria, array $orderBy = null)\n* @method Taxonomy[] findAll()\n* @method Taxonomy[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)\n*/\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/features/dashboard.feature", "new_path": "tests/e2e/features/dashboard.feature", "diff": "Feature: Visiting Dashboard\n+\nScenario: As an admin I want to see Dashboard page\nGiven I am logged in as \"admin\"\nWhen I visit the \"dashboard\" page\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/features/edit_record.feature", "new_path": "tests/e2e/features/edit_record.feature", "diff": "@@ -11,6 +11,7 @@ Feature: Edit record\nAnd I click the \"status_select\" element\nAnd I click the \"status_published\" element\nAnd I click the \"save_button\" element\n+ Then I wait for \"title_field\" element to appear\nWhen I visit the \"single_record\" page with parameters:\n| id | 30 |\n" } ]
PHP
MIT License
bolt/core
relations: fix tests
95,112
26.02.2019 22:23:28
-3,600
8282b6fc5e03d15e4ccd0685db1e9aa74f725998
Lock API Platform to beta1 due to bug
[ { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"ext-json\": \"*\",\n\"ext-pdo\": \"*\",\n\"ext-mbstring\": \"*\",\n- \"api-platform/core\": \"^2.4@beta\",\n+ \"api-platform/core\": \"v2.4.0-beta.1\",\n\"bolt/common\": \"^2.0\",\n\"cocur/slugify\": \"^3.1\",\n\"doctrine/annotations\": \"^1.0\",\n" }, { "change_type": "MODIFY", "old_path": "symfony.lock", "new_path": "symfony.lock", "diff": "\"egulias/email-validator\": {\n\"version\": \"2.1.2\"\n},\n+ \"embed/embed\": {\n+ \"version\": \"v3.3.9\"\n+ },\n\"erusev/parsedown\": {\n\"version\": \"1.6.3\"\n},\n" } ]
PHP
MIT License
bolt/core
Lock API Platform to beta1 due to bug
95,112
26.02.2019 22:37:20
-3,600
40747f1ebeb9e9c1ac04b4f079178c074e8efdac
better conflict resolution in composer.json
[ { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"ext-json\": \"*\",\n\"ext-pdo\": \"*\",\n\"ext-mbstring\": \"*\",\n- \"api-platform/core\": \"v2.4.0-beta.1\",\n+ \"api-platform/core\": \"^2.4@beta\",\n\"bolt/common\": \"^2.0\",\n\"cocur/slugify\": \"^3.1\",\n\"doctrine/annotations\": \"^1.0\",\n},\n\"conflict\": {\n\"symfony/symfony\": \"*\",\n- \"illuminate/support\": \"*\"\n+ \"illuminate/support\": \"*\",\n+ \"api-platform/core\": \"v2.4.0-beta.2\"\n},\n\"extra\": {\n\"symfony\": {\n" } ]
PHP
MIT License
bolt/core
better conflict resolution in composer.json
95,112
27.02.2019 00:03:35
-3,600
41a188f00bcd8ff76f7a440e280031e2d878201f
Test lowest deps in Travis
[ { "change_type": "MODIFY", "old_path": ".travis.yml", "new_path": ".travis.yml", "diff": "@@ -14,6 +14,8 @@ matrix:\ninclude:\n- php: 7.1\n- php: 7.2\n+ - php: 7.2\n+ env: COMPOSER_FLAGS=\"--prefer-lowest\"\n- php: 7.3\n- php: nightly\nenv: COMPOSER_FLAGS=\"--ignore-platform-reqs\"\n@@ -22,10 +24,10 @@ matrix:\nbefore_install:\n- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo \"xdebug not available\"\n- - composer self-update\n+ - composer self-update -q\ninstall:\n- - COMPOSER_MEMORY_LIMIT=-1 composer install $COMPOSER_FLAGS\n+ - COMPOSER_MEMORY_LIMIT=-1 composer update $COMPOSER_FLAGS\n- nvm install 8.2\n- npm install\n- cd tests/e2e && npm install && node ./node_modules/protractor/bin/webdriver-manager update --gecko=false && cd ../..\n" } ]
PHP
MIT License
bolt/core
Test lowest deps in Travis
95,112
27.02.2019 01:06:25
-3,600
0769fdfdea1a66fc9ab33805356276e3c681501c
fix doctrine cache version
[ { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"cocur/slugify\": \"^3.1\",\n\"doctrine/annotations\": \"^1.0\",\n\"doctrine/doctrine-bundle\": \"^1.7\",\n+ \"doctrine/doctrine-cache-bundle\": \"^1.3.1\",\n\"doctrine/doctrine-migrations-bundle\": \"^1.3\",\n\"doctrine/orm\": \"^2.5.11\",\n\"easycorp/easy-log-handler\": \"^1.0.7\",\n" } ]
PHP
MIT License
bolt/core
fix doctrine cache version
95,112
27.02.2019 01:26:30
-3,600
c5b9d56b03554007b50481bad0a1bce7d62e561f
fix swiftmailer bundle version
[ { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"symfony/polyfill-php72\": \"^1.8\",\n\"symfony/security-bundle\": \"^4.2\",\n\"symfony/serializer\": \"^4.2\",\n- \"symfony/swiftmailer-bundle\": \"^3.1\",\n+ \"symfony/swiftmailer-bundle\": \"^3.2\",\n\"symfony/translation\": \"^4.2\",\n\"symfony/twig-bundle\": \"^4.2\",\n\"symfony/validator\": \"^4.2\",\n" } ]
PHP
MIT License
bolt/core
fix swiftmailer bundle version
95,112
27.02.2019 10:59:27
-3,600
c9f956eca1df96600c6f066cd3878d3a7dff9c57
lock api platform version
[ { "change_type": "MODIFY", "old_path": ".travis.yml", "new_path": ".travis.yml", "diff": "@@ -57,7 +57,7 @@ script:\n# this checks that the application doesn't use dependencies with known security vulnerabilities\n- ./bin/console security:check\n# this checks that the composer.json and composer.lock files are valid\n- - composer validate --strict\n+ # - composer validate --strict # temporarily disabled bue to bug in api platform 2.4.0-beta.2\n# this checks that Doctrine's mapping configurations are valid\n- ./bin/console doctrine:schema:validate --skip-sync -vvv --no-interaction\n# run PHP Unit / PHP Spec tests\n" }, { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"ext-json\": \"*\",\n\"ext-pdo\": \"*\",\n\"ext-mbstring\": \"*\",\n- \"api-platform/core\": \"^2.4@beta\",\n+ \"api-platform/core\": \"v2.4.0-beta.1\",\n\"bolt/common\": \"^2.0.2\",\n\"cocur/slugify\": \"^3.1\",\n\"doctrine/annotations\": \"^1.0\",\n\"conflict\": {\n\"symfony/symfony\": \"*\",\n\"illuminate/support\": \"*\",\n- \"api-platform/core\": \"v2.4.0-beta.2, 2.4.x-dev, dev-2.4.x-dev, @dev\"\n+ \"api-platform/core\": \"v2.4.0-beta.2\"\n},\n\"extra\": {\n\"symfony\": {\n" } ]
PHP
MIT License
bolt/core
lock api platform version
95,144
27.02.2019 13:38:47
-3,600
73858be4ec174f1e09a55f91286e5c9b1f7cc33b
Finalising changes
[ { "change_type": "MODIFY", "old_path": "src/Controller/Backend/ContentEditController.php", "new_path": "src/Controller/Backend/ContentEditController.php", "diff": "@@ -17,6 +17,7 @@ use Bolt\\Repository\\TaxonomyRepository;\nuse Bolt\\TemplateChooser;\nuse Carbon\\Carbon;\nuse Doctrine\\Common\\Persistence\\ObjectManager;\n+use Illuminate\\Support\\Collection;\nuse Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Security;\nuse Symfony\\Component\\HttpFoundation\\RedirectResponse;\nuse Symfony\\Component\\HttpFoundation\\Request;\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/TwigAwareController.php", "new_path": "src/Controller/TwigAwareController.php", "diff": "@@ -7,10 +7,10 @@ namespace Bolt\\Controller;\nuse Bolt\\Configuration\\Config;\nuse Bolt\\Entity\\Field\\TemplateselectField;\nuse Bolt\\Version;\n+use Illuminate\\Support\\Collection;\nuse Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Twig\\Environment;\n-use Illuminate\\Support\\Collection;\nclass TwigAwareController extends AbstractController\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Field.php", "new_path": "src/Entity/Field.php", "diff": "@@ -7,8 +7,8 @@ namespace Bolt\\Entity;\nuse Bolt\\Content\\FieldType;\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Gedmo\\Mapping\\Annotation as Gedmo;\n+use Illuminate\\Support\\Collection as LaravelCollection;\nuse Symfony\\Component\\Serializer\\Annotation\\Groups;\n-use Tightenco\\Collect\\Support\\Collection as LaravelCollection;\n/**\n* @ORM\\Entity(repositoryClass=\"Bolt\\Repository\\FieldRepository\")\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Field/SlugField.php", "new_path": "src/Entity/Field/SlugField.php", "diff": "@@ -7,7 +7,7 @@ namespace Bolt\\Entity\\Field;\nuse Bolt\\Entity\\Field;\nuse Bolt\\Utils\\Str;\nuse Doctrine\\ORM\\Mapping as ORM;\n-use Tightenco\\Collect\\Support\\Collection;\n+use Illuminate\\Support\\Collection;\n/**\n* @ORM\\Entity\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/ContentExtension.php", "new_path": "src/Twig/ContentExtension.php", "diff": "@@ -10,11 +10,11 @@ use Bolt\\Entity\\Field\\ImageField;\nuse Bolt\\Repository\\ContentRepository;\nuse Bolt\\Utils\\Excerpt;\nuse Bolt\\Utils\\Html;\n+use Illuminate\\Support\\Collection;\nuse Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface;\nuse Twig\\Extension\\AbstractExtension;\nuse Twig\\TwigFilter;\nuse Twig\\TwigFunction;\n-use Illuminate\\Support\\Collection;\nclass ContentExtension extends AbstractExtension\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/FieldExtension.php", "new_path": "src/Twig/FieldExtension.php", "diff": "@@ -5,7 +5,7 @@ declare(strict_types=1);\nnamespace Bolt\\Twig;\nuse Bolt\\Entity\\Field;\n-use Tightenco\\Collect\\Support\\Collection;\n+use Illuminate\\Support\\Collection;\nuse Twig\\Extension\\AbstractExtension;\nuse Twig\\TwigFunction;\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/RecordExtension.php", "new_path": "src/Twig/RecordExtension.php", "diff": "@@ -10,6 +10,7 @@ use Bolt\\Menu\\MenuBuilder;\nuse Bolt\\Repository\\TaxonomyRepository;\nuse Bolt\\Utils\\Excerpt;\nuse Doctrine\\Common\\Collections\\Collection;\n+use Illuminate\\Support\\Collection as LaravelCollection;\nuse Symfony\\Contracts\\Translation\\TranslatorInterface;\nuse Twig\\Environment;\nuse Twig\\Extension\\AbstractExtension;\n@@ -125,7 +126,7 @@ class RecordExtension extends AbstractExtension\nreturn json_encode($result, $options);\n}\n- public function selectoptionsfromarray(Field $field): \\Tightenco\\Collect\\Support\\Collection\n+ public function selectoptionsfromarray(Field $field): LaravelCollection\n{\n$values = $field->getDefinition()->get('values');\n$currentValues = $field->getValue();\n@@ -141,7 +142,7 @@ class RecordExtension extends AbstractExtension\n}\nif (! is_iterable($values)) {\n- return new Collection($options);\n+ return new LaravelCollection($options);\n}\nforeach ($values as $key => $value) {\n@@ -152,10 +153,10 @@ class RecordExtension extends AbstractExtension\n];\n}\n- return new Collection($options);\n+ return new LaravelCollection($options);\n}\n- public function taxonomyoptions($taxonomy): \\Illuminate\\Support\\Collection\n+ public function taxonomyoptions($taxonomy): LaravelCollection\n{\n$options = [];\n@@ -173,10 +174,10 @@ class RecordExtension extends AbstractExtension\n];\n}\n- return new Collection($options);\n+ return new LaravelCollection($options);\n}\n- public function taxonomyvalues(Collection $current, $taxonomy): \\Illuminate\\Support\\Collection\n+ public function taxonomyvalues(Collection $current, $taxonomy): LaravelCollection\n{\n$values = [];\n@@ -192,6 +193,6 @@ class RecordExtension extends AbstractExtension\n$values[] = key($taxonomy['options']);\n}\n- return new Collection($values);\n+ return new LaravelCollection($values);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Twig/RelatedExtension.php", "new_path": "src/Twig/RelatedExtension.php", "diff": "@@ -7,10 +7,10 @@ namespace Bolt\\Twig;\nuse Bolt\\Entity\\Content;\nuse Bolt\\Entity\\Relation;\nuse Bolt\\Repository\\RelationRepository;\n+use Illuminate\\Support\\Collection;\nuse Twig\\Extension\\AbstractExtension;\nuse Twig\\TwigFilter;\nuse Twig\\TwigFunction;\n-use Illuminate\\Support\\Collection;\nclass RelatedExtension extends AbstractExtension\n{\n" }, { "change_type": "MODIFY", "old_path": "templates/content/listing.html.twig", "new_path": "templates/content/listing.html.twig", "diff": "{% block vue_id 'listing' %}\n+{# This 'topsection' gets output _before_ the main form, allowing `dump()`, without breaking Vue #}\n+{% block topsection %}\n+\n+{% endblock %}\n+\n{% block main %}\n<div>\n{% include '@bolt/_partials/_content_listing.html.twig' with {'records': records, 'type': contentType.slug } %}\n" } ]
PHP
MIT License
bolt/core
Finalising changes
95,144
27.02.2019 14:21:13
-3,600
5a9dfae29a72c5864c3df89caf1c78c8e61e8ee0
Cleanup in symfony.lock
[ { "change_type": "MODIFY", "old_path": "symfony.lock", "new_path": "symfony.lock", "diff": "\"guzzlehttp/psr7\": {\n\"version\": \"1.4.2\"\n},\n- \"illuminate/contracts\": {\n- \"version\": \"v5.8.0\"\n- },\n- \"illuminate/support\": {\n- \"version\": \"v5.8.0\"\n- },\n\"intervention/image\": {\n\"version\": \"2.4.2\"\n},\n" } ]
PHP
MIT License
bolt/core
Cleanup in symfony.lock
95,144
27.02.2019 14:55:03
-3,600
7c7a57e99818ed11cd7a4741308c3087bb305890
Return `->filter()` to original position.
[ { "change_type": "MODIFY", "old_path": "src/Controller/Backend/ContentEditController.php", "new_path": "src/Controller/Backend/ContentEditController.php", "diff": "@@ -236,7 +236,7 @@ class ContentEditController extends TwigAwareController\nprivate function updateTaxonomy(Content $content, string $key, $taxonomy): void\n{\n- $taxonomy = new Collection(Json::findArray($taxonomy));\n+ $taxonomy = (new Collection(Json::findArray($taxonomy)))->filter();\n// Remove old ones\nforeach ($content->getTaxonomies($key) as $current) {\n@@ -244,7 +244,7 @@ class ContentEditController extends TwigAwareController\n}\n// Then (re-) add selected ones\n- foreach ($taxonomy->filter() as $slug) {\n+ foreach ($taxonomy as $slug) {\n$taxonomy = $this->taxonomyRepository->findOneBy([\n'type' => $key,\n'slug' => $slug,\n" } ]
PHP
MIT License
bolt/core
Return `->filter()` to original position.
95,144
27.02.2019 16:07:43
-3,600
4a8aa1fe9ca7de6196b7a9fb1e2caa2720751aac
Update package.json. Fix NPM security advisories
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "{\n\"name\": \"bolt\",\n- \"version\": \"4.0.0-alpha.0\",\n+ \"version\": \"4.0.0-alpha.2\",\n\"homepage\": \"https://bolt.cm\",\n\"author\": \"Bob den Otter <bob@twokings.nl> (https://bolt.cm)\",\n\"license\": \"MIT\",\n- \"description\": \"Bolt 4.0.0 prototype\",\n+ \"description\": \"Bolt 4 npm/javascript packages\",\n\"keywords\": [\n\"bolt\",\n\"cms\",\n},\n\"dependencies\": {\n\"@babel/polyfill\": \"^7.2.5\",\n- \"@vue/cli-service\": \"^3.3.0\",\n+ \"@vue/cli-service\": \"^3.4.1\",\n\"axios\": \"^0.18.0\",\n\"baguettebox.js\": \"^1.11.0\",\n- \"bootstrap\": \"^4.2.1\",\n- \"codemirror\": \"^5.43.0\",\n+ \"bootstrap\": \"^4.3.1\",\n+ \"codemirror\": \"^5.44.0\",\n\"flagpack\": \"^1.0.3\",\n\"jquery\": \"^3.3.1\",\n\"moment\": \"^2.24.0\",\n\"no-scroll\": \"^2.1.1\",\n\"popper.js\": \"^1.14.7\",\n- \"register-service-worker\": \"^1.5.2\",\n+ \"register-service-worker\": \"^1.6.2\",\n\"simplemde\": \"^1.11.2\",\n\"stylelint-config-recommended-scss\": \"^3.2.0\",\n- \"stylelint-scss\": \"^3.5.1\",\n- \"terser\": \"3.14.1\",\n+ \"stylelint-scss\": \"^3.5.4\",\n+ \"terser\": \"^3.16.1\",\n\"tinycolor2\": \"^1.4.1\",\n- \"vue\": \"^2.5.22\",\n+ \"vue\": \"^2.6.7\",\n\"vue-flatpickr-component\": \"^8.1.1\",\n\"vue-multiselect\": \"^2.1.3\",\n- \"vue-notification\": \"^1.3.15\",\n+ \"vue-notification\": \"^1.3.16\",\n\"vue-simplemde\": \"^0.5.1\",\n\"vue-trumbowyg\": \"^3.4.1\",\n- \"vuedraggable\": \"^2.17.0\",\n+ \"vuedraggable\": \"^2.18.1\",\n\"vuex\": \"^3.1.0\"\n},\n\"devDependencies\": {\n- \"@babel/core\": \"^7.2.2\",\n- \"@babel/plugin-transform-regenerator\": \"^7.0.0\",\n- \"@babel/plugin-transform-runtime\": \"^7.2.0\",\n+ \"@babel/core\": \"^7.3.4\",\n+ \"@babel/plugin-transform-regenerator\": \"^7.3.4\",\n+ \"@babel/plugin-transform-runtime\": \"^7.3.4\",\n\"@babel/polyfill\": \"^7.2.5\",\n- \"@babel/preset-env\": \"^7.3.1\",\n- \"@symfony/webpack-encore\": \"^0.22.4\",\n+ \"@babel/preset-env\": \"^7.3.4\",\n+ \"@symfony/webpack-encore\": \"^0.23.0\",\n\"@vue/test-utils\": \"^1.0.0-beta.29\",\n- \"ajv-keywords\": \"^3.3.0\",\n- \"autoprefixer\": \"^9.4.6\",\n+ \"ajv-keywords\": \"^3.4.0\",\n+ \"autoprefixer\": \"^9.4.9\",\n\"babel-core\": \"^7.0.0-bridge.0\",\n\"babel-eslint\": \"^10.0.1\",\n\"babel-jest\": \"^24.1.0\",\n- \"eslint\": \"5.12.0\",\n- \"eslint-config-prettier\": \"^3.6.0\",\n+ \"eslint\": \"^5.14.1\",\n+ \"eslint-config-prettier\": \"^4.1.0\",\n\"eslint-plugin-prettier\": \"^3.0.1\",\n\"eslint-plugin-standard\": \"^4.0.0\",\n- \"eslint-plugin-vue\": \"^5.1.0\",\n+ \"eslint-plugin-vue\": \"^5.2.2\",\n\"jest\": \"^24.1.0\",\n\"jest-serializer-vue\": \"^2.0.2\",\n\"node-sass\": \"^4.11.0\",\n\"postcss-loader\": \"^3.0.0\",\n\"postcss-preset-env\": \"^6.5.0\",\n- \"prettier\": \"1.15.3\",\n+ \"prettier\": \"^1.16.4\",\n\"regenerator-runtime\": \"^0.13.1\",\n\"sass-loader\": \"^7.1.0\",\n\"stylelint\": \"^9.10.1\",\n\"stylelint-config-standard\": \"^18.2.0\",\n- \"vue-jest\": \"^3.0.2\",\n- \"vue-loader\": \"^15.6.1\",\n+ \"vue-jest\": \"^3.0.3\",\n+ \"vue-loader\": \"^15.6.4\",\n\"vue-router\": \"^3.0.2\",\n- \"vue-template-compiler\": \"^2.5.22\",\n+ \"vue-template-compiler\": \"^2.6.7\",\n\"webpackbar\": \"^3.1.5\",\n\"workbox-webpack-plugin\": \"^3.6.3\"\n},\n" } ]
PHP
MIT License
bolt/core
Update package.json. Fix NPM security advisories
95,112
27.02.2019 16:51:35
-3,600
9939a16c302918349e8f4adfb9473261618d25a8
another composer fixes
[ { "change_type": "MODIFY", "old_path": ".travis.yml", "new_path": ".travis.yml", "diff": "@@ -13,14 +13,16 @@ matrix:\nfast_finish: true\ninclude:\n- php: 7.1\n- - php: 7.2\n- - php: 7.2\n+ - php: 7.1\nenv: COMPOSER_FLAGS=\"--prefer-lowest\"\n+ - php: 7.2\n- php: 7.3\n- php: nightly\nenv: COMPOSER_FLAGS=\"--ignore-platform-reqs\"\nallow_failures:\n- php: nightly\n+ - php: 7.1\n+ env: COMPOSER_FLAGS=\"--prefer-lowest\"\nbefore_install:\n- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo \"xdebug not available\"\n" }, { "change_type": "MODIFY", "old_path": "composer.json", "new_path": "composer.json", "diff": "\"gedmo/doctrine-extensions\": \"^2.4.4\",\n\"symfony/asset\": \"^4.2\",\n\"symfony/console\": \"^4.2\",\n+ \"symfony/dependency-injection\": \"^4.2\",\n\"symfony/expression-language\": \"^4.2\",\n- \"symfony/flex\": \"^1.1\",\n+ \"symfony/flex\": \"^1.2\",\n\"symfony/form\": \"^4.2\",\n\"symfony/framework-bundle\": \"^4.2\",\n- \"symfony/monolog-bundle\": \"^3.0\",\n+ \"symfony/monolog-bridge\": \"^4.1\",\n+ \"symfony/monolog-bundle\": \"^3.3\",\n\"symfony/polyfill-php72\": \"^1.8\",\n\"symfony/security-bundle\": \"^4.2\",\n\"symfony/serializer\": \"^4.2\",\n+ \"symfony/stopwatch\": \"^4.2\",\n\"symfony/swiftmailer-bundle\": \"^3.2\",\n\"symfony/translation\": \"^4.2\",\n\"symfony/twig-bundle\": \"^4.2\",\n\"symfony/debug-bundle\": \"^4.2\",\n\"symfony/dotenv\": \"^4.2\",\n\"symfony/maker-bundle\": \"^1.11\",\n- \"symfony/stopwatch\": \"^4.2\",\n\"symfony/web-profiler-bundle\": \"^4.2\",\n\"symfony/web-server-bundle\": \"^4.2\",\n\"symplify/easy-coding-standard\": \"^5.4.6\"\n" }, { "change_type": "MODIFY", "old_path": "symfony.lock", "new_path": "symfony.lock", "diff": "\"version\": \"1.2.0\"\n},\n\"dama/doctrine-test-bundle\": {\n- \"version\": \"v4.0.1\"\n+ \"version\": \"4.0\",\n+ \"recipe\": {\n+ \"repo\": \"github.com/symfony/recipes-contrib\",\n+ \"branch\": \"master\",\n+ \"version\": \"4.0\",\n+ \"ref\": \"56eaa387b5e48ebcc7c95a893b47dfa1ad51449c\"\n+ },\n+ \"files\": [\n+ \"config/packages/test/dama_doctrine_test_bundle.yaml\"\n+ ]\n},\n\"doctrine/annotations\": {\n\"version\": \"v1.5.0\"\n\"version\": \"v2.8.1\"\n},\n\"doctrine/data-fixtures\": {\n- \"version\": \"v1.3.1\"\n+ \"version\": \"v1.3.0\"\n},\n\"doctrine/dbal\": {\n\"version\": \"v2.6.2\"\n\"repo\": \"github.com/symfony/recipes\",\n\"branch\": \"master\",\n\"version\": \"3.0\",\n- \"ref\": \"2ea6070ecf365f9a801ccaed4b31d4a3b7af5693\"\n- }\n+ \"ref\": \"fc52d86631a6dfd9fdf3381d0b7e3df2069e51b3\"\n+ },\n+ \"files\": [\n+ \"src/DataFixtures/AppFixtures.php\"\n+ ]\n},\n\"doctrine/doctrine-migrations-bundle\": {\n\"version\": \"1.2\",\n\"ref\": \"89239f0cf2759efccc76b9944083bfcc4d180f9d\"\n}\n},\n- \"phpunit/phpunit-mock-objects\": {\n- \"version\": \"6.0.0\"\n- },\n\"psr/cache\": {\n\"version\": \"1.0.1\"\n},\n\"psr/simple-cache\": {\n\"version\": \"1.0.0\"\n},\n+ \"ralouphie/getallheaders\": {\n+ \"version\": \"2.0.5\"\n+ },\n\"roave/security-advisories\": {\n\"version\": \"dev-master\"\n},\n},\n\"zendframework/zend-eventmanager\": {\n\"version\": \"3.2.0\"\n- },\n- \"zendframework/zend-stdlib\": {\n- \"version\": \"2.2.6\"\n}\n}\n" } ]
PHP
MIT License
bolt/core
another composer fixes
95,112
11.02.2019 12:46:20
-3,600
6fb8fb294230ed8b4d3135c9ecdb55794ed5d435
Embed refactor
[ { "change_type": "RENAME", "old_path": "src/Controller/Async/Embed.php", "new_path": "src/Controller/Backend/Async/EmbedController.php", "diff": "declare(strict_types=1);\n-namespace Bolt\\Controller\\Async;\n+namespace Bolt\\Controller\\Backend\\Async;\n+use Bolt\\Controller\\CsrfTrait;\nuse Embed\\Embed as EmbedFactory;\nuse Embed\\Exceptions\\InvalidUrlException;\nuse Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Security;\n@@ -11,16 +12,15 @@ use Symfony\\Component\\HttpFoundation\\JsonResponse;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Component\\Routing\\Annotation\\Route;\n-use Symfony\\Component\\Security\\Csrf\\CsrfToken;\n+use Symfony\\Component\\Security\\Core\\Exception\\InvalidCsrfTokenException;\nuse Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface;\n/**\n* @Security(\"has_role('ROLE_ADMIN')\")\n*/\n-final class Embed\n+class EmbedController\n{\n- /** @var CsrfTokenManagerInterface */\n- private $csrfTokenManager;\n+ use CsrfTrait;\npublic function __construct(CsrfTokenManagerInterface $csrfTokenManager)\n{\n@@ -28,17 +28,13 @@ final class Embed\n}\n/**\n- * @Route(\n- * \"/embed\",\n- * name=\"bolt_embed\",\n- * methods={\"POST\"})\n+ * @Route(\"/embed\", name=\"bolt_embed\", methods={\"POST\"})\n*/\n- public function __invoke(Request $request): JsonResponse\n+ public function fetchEmbed(Request $request): JsonResponse\n{\n- $csrfToken = $request->request->get('_csrf_token');\n- $token = new CsrfToken('editrecord', $csrfToken);\n-\n- if (! $this->csrfTokenManager->isTokenValid($token)) {\n+ try {\n+ $this->validateCsrf($request, 'editrecord');\n+ } catch (InvalidCsrfTokenException $e) {\nreturn new JsonResponse(['error' => ['message' => 'Invalid CSRF token']], Response::HTTP_FORBIDDEN);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Controller/Backend/Async/UploadController.php", "new_path": "src/Controller/Backend/Async/UploadController.php", "diff": "@@ -12,9 +12,11 @@ use Doctrine\\Common\\Persistence\\ObjectManager;\nuse Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Security;\nuse Sirius\\Upload\\Handler;\nuse Sirius\\Upload\\Result\\File;\n+use Symfony\\Component\\HttpFoundation\\JsonResponse;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Component\\Routing\\Annotation\\Route;\n+use Symfony\\Component\\Security\\Core\\Exception\\InvalidCsrfTokenException;\nuse Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface;\nuse Webmozart\\PathUtil\\Path;\n@@ -45,9 +47,13 @@ class UploadController\n/**\n* @Route(\"/upload\", name=\"bolt_async_upload\", methods={\"POST\"})\n*/\n- public function upload(Request $request)\n+ public function handleUpload(Request $request): JsonResponse\n{\n+ try {\n$this->validateCsrf($request, 'upload');\n+ } catch (InvalidCsrfTokenException $e) {\n+ return new JsonResponse(['error' => ['message' => 'Invalid CSRF token']], Response::HTTP_FORBIDDEN);\n+ }\n$area = $request->query->get('area', '');\n$path = $request->query->get('path', '');\n@@ -84,7 +90,7 @@ class UploadController\n$this->em->persist($media);\n$this->em->flush();\n- return new Response($media->getFilenamePath());\n+ return new JsonResponse($media->getFilenamePath());\n} catch (\\Throwable $e) {\n// something wrong happened, we don't need the uploaded files anymore\n$result->clear();\n@@ -95,7 +101,7 @@ class UploadController\n// image was not moved to the container, where are error messages\n$messages = $result->getMessages();\n- return new Response('Not OK: ' . implode(', ', $messages), 400);\n+ return new JsonResponse(['error' => ['message' => implode(', ', $messages)]], Response::HTTP_BAD_REQUEST);\n}\nprivate function sanitiseFilename(string $filename): string\n" }, { "change_type": "MODIFY", "old_path": "symfony.lock", "new_path": "symfony.lock", "diff": "\"egulias/email-validator\": {\n\"version\": \"2.1.2\"\n},\n+ \"embed/embed\": {\n+ \"version\": \"v3.3.7\"\n+ },\n\"erusev/parsedown\": {\n\"version\": \"1.6.3\"\n},\n" } ]
PHP
MIT License
bolt/core
Embed refactor
95,144
02.03.2019 14:33:05
-3,600
8a331b4d7cd3e012cc7b4d90c9caccb7210c2207
Limit length of indexed column to 191
[ { "change_type": "MODIFY", "old_path": "src/Entity/Translation.php", "new_path": "src/Entity/Translation.php", "diff": "@@ -4,29 +4,35 @@ declare(strict_types=1);\nnamespace Gedmo\\Translatable\\Entity;\n-use Doctrine\\ORM\\Mapping\\Entity;\n-use Doctrine\\ORM\\Mapping\\Index;\n-use Doctrine\\ORM\\Mapping\\Table;\n-use Doctrine\\ORM\\Mapping\\UniqueConstraint;\n+use Doctrine\\ORM\\Mapping as ORM;\n/**\n* Gedmo\\Translatable\\Entity\\Translation\n*\n- * @Table(\n+ * @ORM\\Table(\n* name=\"translation\",\n* options={\"row_format\":\"DYNAMIC\"},\n- * indexes={@Index(name=\"translations_lookup_idx\", columns={\n+ * indexes={@ORM\\Index(name=\"translations_lookup_idx\", columns={\n* \"locale\", \"object_class\", \"foreign_key\"\n* })},\n- * uniqueConstraints={@UniqueConstraint(name=\"lookup_unique_idx\", columns={\n+ * uniqueConstraints={@ORM\\UniqueConstraint(name=\"lookup_unique_idx\", columns={\n* \"locale\", \"object_class\", \"field\", \"foreign_key\"\n* })}\n* )\n- * @Entity(repositoryClass=\"Gedmo\\Translatable\\Entity\\Repository\\TranslationRepository\")\n+ * @ORM\\Entity(repositoryClass=\"Gedmo\\Translatable\\Entity\\Repository\\TranslationRepository\")\n*/\nclass Translation extends MappedSuperclass\\AbstractTranslation\n{\n- /*\n- * All required columns are mapped through inherited superclass\n+ /**\n+ * All required columns are mapped through inherited superclass, except\n+ * for $objectClass, because we need to limit the length to 191, for MySQL 5.6\n+ * compatibility. See https://github.com/doctrine/orm/issues/7416\n+ */\n+\n+ /**\n+ * @var string\n+ *\n+ * @ORM\\Column(name=\"object_class\", type=\"string\", length=191)\n*/\n+ protected $objectClass;\n}\n" } ]
PHP
MIT License
bolt/core
Limit length of indexed column to 191
95,144
02.03.2019 17:49:46
-3,600
f280931f9f146eef72f73ff47a69f3bbd8aa874c
Small changes to labels and translations
[ { "change_type": "MODIFY", "old_path": "src/Controller/Backend/ClearCacheController.php", "new_path": "src/Controller/Backend/ClearCacheController.php", "diff": "@@ -12,12 +12,20 @@ use Symfony\\Component\\Console\\Output\\BufferedOutput;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Component\\HttpKernel\\KernelInterface;\nuse Symfony\\Component\\Routing\\Annotation\\Route;\n+use Symfony\\Contracts\\Translation\\TranslatorInterface;\n/**\n* @Security(\"has_role('ROLE_ADMIN')\")\n*/\nclass ClearCacheController extends AbstractController\n{\n+ /** @var TranslatorInterface */\n+ private $translator;\n+\n+ public function __construct(TranslatorInterface $translator)\n+ {\n+ $this->translator = $translator;\n+ }\n/**\n* @Route(\"/clearcache\", name=\"bolt_clear_cache\")\n*/\n@@ -33,7 +41,7 @@ class ClearCacheController extends AbstractController\n$output = new BufferedOutput();\n$application->run($input, $output);\n- $this->addFlash('success', 'Cache cleared!');\n+ $this->addFlash('success', $this->translator->trans('label.cache_cleared'));\n$twigvars = [\n'output' => $output->fetch(),\n" }, { "change_type": "MODIFY", "old_path": "src/Menu/MenuBuilder.php", "new_path": "src/Menu/MenuBuilder.php", "diff": "@@ -238,6 +238,23 @@ class MenuBuilder\n],\n]);\n+ // @todo When we're close to stable release, make this less prominent\n+ $menu->getChild('Maintenance')->addChild('The Kitchensink', [\n+ 'uri' => $this->urlGenerator->generate('bolt_kitchensink'),\n+ 'extras' => [\n+ 'name' => $t->trans('caption.kitchensink'),\n+ 'icon' => 'fa-bath',\n+ ],\n+ ]);\n+\n+ $menu->getChild('Maintenance')->addChild('About Bolt', [\n+ 'uri' => $this->urlGenerator->generate('bolt_about'),\n+ 'extras' => [\n+ 'name' => $t->trans('caption.about_bolt'),\n+ 'icon' => 'fa-award',\n+ ],\n+ ]);\n+\n// File Management submenu\n$menu->addChild('File Management', ['extras' => [\n@@ -261,14 +278,6 @@ class MenuBuilder\n],\n]);\n- $menu->addChild('The Kitchensink', [\n- 'uri' => $this->urlGenerator->generate('bolt_kitchensink'),\n- 'extras' => [\n- 'icon' => 'fa-bath',\n- 'singleton' => true,\n- ],\n- ]);\n-\n$this->stopwatch->stop('bolt.sidebar');\nreturn $menu;\n" }, { "change_type": "MODIFY", "old_path": "translations/messages.en.xlf", "new_path": "translations/messages.en.xlf", "diff": "<target>Displayname</target>\n</segment>\n</unit>\n+ <unit id=\"2MMvCKK\" name=\"label.cache_cleared\">\n+ <segment>\n+ <source>label.cache_cleared</source>\n+ <target>Cache cleared succesfully!</target>\n+ </segment>\n+ </unit>\n+ <unit id=\"Wou02nK\" name=\"caption.kitchensink\">\n+ <segment>\n+ <source>caption.kitchensink</source>\n+ <target>The Kitchensink</target>\n+ </segment>\n+ </unit>\n</file>\n</xliff>\n" }, { "change_type": "MODIFY", "old_path": "translations/validators.en.xlf", "new_path": "translations/validators.en.xlf", "diff": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n-<xliff xmlns=\"urn:oasis:names:tc:xliff:document:2.0\" version=\"2.0\" srcLang=\"pl\" trgLang=\"en\">\n+<xliff xmlns=\"urn:oasis:names:tc:xliff:document:2.0\" version=\"2.0\" srcLang=\"en\" trgLang=\"en\">\n<file id=\"validators.en\">\n<unit id=\"TG1D5NO\" name=\"post.blank_summary\">\n<notes>\n" } ]
PHP
MIT License
bolt/core
Small changes to labels and translations
95,144
06.03.2019 15:44:46
-3,600
44dd621d24c58b45c93d7b15b077baf8d21f993e
Use `config.has()`
[ { "change_type": "MODIFY", "old_path": "public/theme/skeleton/partials/_header.twig", "new_path": "public/theme/skeleton/partials/_header.twig", "diff": "<header>\n{# the values in the 'config' object are taken directly from the file app/config/config.yml #}\n<h2><a href=\"{{ path('homepage') }}\">{{ config.get('general/sitename') }}</a></h2>\n- {% if config.get('general/payoff') %}\n+ {% if config.has('general/payoff') %}\n<p>{{ config.get('general/payoff') }}</p>\n{% endif %}\n" }, { "change_type": "MODIFY", "old_path": "public/theme/skeleton/partials/_master.twig", "new_path": "public/theme/skeleton/partials/_master.twig", "diff": "<title>\n{%- if record.hasField('title') %}{{ record.title|striptags }} | {% endif -%}\n{{ config.get('general/sitename') -}}\n- {% if not record.hasField('title') and config.get('general/payoff') %} | {{ config.get('general/payoff') }}{% endif -%}\n+ {% if not record.hasField('title') and config.has('general/payoff') %} | {{ config.get('general/payoff') }}{% endif -%}\n</title>\n{#<link rel=\"stylesheet\" href=\"{{ asset('css/normalize.css', 'theme') }}\">#}\n{#<link rel=\"stylesheet\" href=\"{{ asset('css/sakura.css', 'theme') }}\">#}\n" } ]
PHP
MIT License
bolt/core
Use `config.has()`
95,144
06.03.2019 16:33:10
-3,600
88a0e5a59f9d78135dda7c327c23db75cf009a3a
Implement missing `config::has()` method
[ { "change_type": "MODIFY", "old_path": "src/Configuration/Config.php", "new_path": "src/Configuration/Config.php", "diff": "@@ -148,6 +148,11 @@ class Config\nreturn Arr::get($this->data, $path, $default);\n}\n+ public function has(string $path): bool\n+ {\n+ return Arr::has($this->data, $path);\n+ }\n+\npublic function getPath(string $path, bool $absolute = true, $additional = null): string\n{\nreturn $this->pathResolver->resolve($path, $absolute, $additional);\n" } ]
PHP
MIT License
bolt/core
Implement missing `config::has()` method
95,144
06.03.2019 17:34:37
-3,600
62cd2f1b0289fe067f7fa7710a40512cccfe543b
Working on kakunin test for preview
[ { "change_type": "ADD", "old_path": null, "new_path": "tests/e2e/features/edit_preview.feature", "diff": "+Feature: Edit record\n+\n+ @wip\n+ Scenario: As an Admin I want to preview an edited record\n+ Given I am logged in as \"admin\"\n+\n+ When I visit the \"edit_record\" page with parameters:\n+ | id | 30 |\n+ Then I wait for \"title_field\" element to appear\n+\n+ When I fill the \"title_field\" field with \"Check preview\"\n+ And I click the \"preview_button\" element\n+ Then I wait for \"frontend_title\" element to appear\n+ Then there is element \"frontend_title\" with text \"Check preview\"\n+\n+\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/pages/edit_record.js", "new_path": "tests/e2e/pages/edit_record.js", "diff": "@@ -21,7 +21,11 @@ class EditRecordPage extends BasePage {\nthis.embed_title = $('[name=\"fields[embed][title]\"]');\nthis.embed_author = $('[name=\"fields[embed][authorname]\"]');\n- this.save_button = $('button[type=\"submit\"]');\n+ this.save_button = $('button[type=\"submit\"]:not([formaction])');\n+ this.preview_button = $('button[type=\"submit\"][formaction*=\"/bolt/preview/\"]');\n+ this.viewsaved_button = $('button[type=\"submit\"][formaction*=\"/bolt/viewsaved/\"]');\n+\n+ this.frontend_title = $('h1.title');\n}\n}\n" } ]
PHP
MIT License
bolt/core
Working on kakunin test for preview
95,144
06.03.2019 17:42:38
-3,600
1764a905bf08edf46ead8553131e42e0690f8300
Fix Feature title
[ { "change_type": "MODIFY", "old_path": "tests/e2e/features/edit_preview.feature", "new_path": "tests/e2e/features/edit_preview.feature", "diff": "-Feature: Edit record\n+Feature: Preview record after editing\n@wip\nScenario: As an Admin I want to preview an edited record\n@@ -12,5 +12,3 @@ Feature: Edit record\nAnd I click the \"preview_button\" element\nThen I wait for \"frontend_title\" element to appear\nThen there is element \"frontend_title\" with text \"Check preview\"\n-\n-\n" } ]
PHP
MIT License
bolt/core
Fix Feature title
95,144
07.03.2019 16:10:36
-3,600
f8cafb347f7e206e5a7dd9bede33a08213f151d4
Updating tests for "preview" and "view saved"
[ { "change_type": "MODIFY", "old_path": "tests/e2e/features/edit_preview.feature", "new_path": "tests/e2e/features/edit_preview.feature", "diff": "@@ -10,5 +10,21 @@ Feature: Preview record after editing\nWhen I fill the \"title_field\" field with \"Check preview\"\nAnd I click the \"preview_button\" element\n- Then I wait for \"frontend_title\" element to appear\n+\n+ When I switch to window number \"2\" of a browser\nThen there is element \"frontend_title\" with text \"Check preview\"\n+\n+ @wip\n+ Scenario: As an Admin I want to check the \"saved version\"\n+ Given I am logged in as \"admin\"\n+\n+ When I visit the \"edit_record\" page with parameters:\n+ | id | 30 |\n+ Then I wait for \"title_field\" element to appear\n+\n+ When I fill the \"title_field\" field with \"Check saved version\"\n+ And I click the \"dropdown_button\" element\n+ And I click the \"viewsaved_button\" element\n+\n+ When I switch to window number \"3\" of a browser\n+ Then there is element \"frontend_title\" with text \"Changed title\"\n" }, { "change_type": "MODIFY", "old_path": "tests/e2e/pages/edit_record.js", "new_path": "tests/e2e/pages/edit_record.js", "diff": "@@ -21,9 +21,10 @@ class EditRecordPage extends BasePage {\nthis.embed_title = $('[name=\"fields[embed][title]\"]');\nthis.embed_author = $('[name=\"fields[embed][authorname]\"]');\n- this.save_button = $('button[type=\"submit\"]:not([formaction])');\n- this.preview_button = $('button[type=\"submit\"][formaction*=\"/bolt/preview/\"]');\n- this.viewsaved_button = $('button[type=\"submit\"][formaction*=\"/bolt/viewsaved/\"]');\n+ this.save_button = $('#metadata [type=\"submit\"]:not([formaction])');\n+ this.preview_button = $('#metadata [type=\"submit\"][formaction*=\"/bolt/preview/\"]');\n+ this.dropdown_button = $('#metadata button.dropdown-toggle');\n+ this.viewsaved_button = $('#metadata button[type=\"submit\"][formaction*=\"/bolt/viewsaved/\"]');\nthis.frontend_title = $('h1.title');\n}\n" } ]
PHP
MIT License
bolt/core
Updating tests for "preview" and "view saved"
95,144
07.03.2019 16:32:22
-3,600
402e3de40989568baf1599189dcd664433beea12
Close browser windows when done.
[ { "change_type": "MODIFY", "old_path": "tests/e2e/features/edit_record_2.feature", "new_path": "tests/e2e/features/edit_record_2.feature", "diff": "Feature: Preview record after editing\n- @wip\nScenario: As an Admin I want to preview an edited record\nGiven I am logged in as \"admin\"\n@@ -13,8 +12,8 @@ Feature: Preview record after editing\nWhen I switch to window number \"2\" of a browser\nThen there is element \"frontend_title\" with text \"Check preview\"\n+ And I close the current browser tab\n- @wip\nScenario: As an Admin I want to check the \"saved version\"\nGiven I am logged in as \"admin\"\n@@ -26,5 +25,6 @@ Feature: Preview record after editing\nAnd I click the \"dropdown_button\" element\nAnd I click the \"viewsaved_button\" element\n- When I switch to window number \"3\" of a browser\n+ When I switch to window number \"2\" of a browser\nThen there is element \"frontend_title\" with text \"Changed title\"\n+ And I close the current browser tab\n" } ]
PHP
MIT License
bolt/core
Close browser windows when done.
95,144
08.03.2019 15:45:09
-3,600
954502ccfda6624c52a34c0841c07c61092a85dd
Make "POST" work for 'new record' controller
[ { "change_type": "MODIFY", "old_path": "src/Controller/Backend/ContentEditController.php", "new_path": "src/Controller/Backend/ContentEditController.php", "diff": "@@ -79,7 +79,7 @@ class ContentEditController extends TwigAwareController\n}\n/**\n- * @Route(\"/new/{contentType}\", name=\"bolt_content_new\", methods={\"GET\"})\n+ * @Route(\"/new/{contentType}\", name=\"bolt_content_new\", methods={\"GET|POST\"})\n*/\npublic function new(string $contentType, Request $request): Response\n{\n@@ -88,6 +88,10 @@ class ContentEditController extends TwigAwareController\n$content->setContentType($contentType);\n$this->contentFillListener->fillContent($content);\n+ if ($request->getMethod() === 'POST') {\n+ return $this->save($request, $content);\n+ }\n+\nreturn $this->edit($request, $content);\n}\n" } ]
PHP
MIT License
bolt/core
Make "POST" work for 'new record' controller
95,144
08.03.2019 17:08:57
-3,600
bab15e2a32bc2847a8395282916f1f3ad5c899a2
Adding template.
[ { "change_type": "MODIFY", "old_path": "config/bolt/contenttypes.yaml", "new_path": "config/bolt/contenttypes.yaml", "diff": "@@ -322,9 +322,10 @@ blocks:\nicon_one: \"fa:cube\"\n-dummies:\n- name: Dummies\n- singular_name: Dummy\n+# This contenttype is here to use for (automated) tests.\n+tests:\n+ name: Tests\n+ singular_name: Test\nfields:\ntitle:\ntype: text\n@@ -333,6 +334,14 @@ dummies:\nslug:\ntype: slug\nuses: title\n+ text_markup:\n+ type: text\n+ allow:\n+ markup: true\n+ text_plain:\n+ type: text\n+ allow:\n+ markup: false\nselectfield:\ntype: select\nvalues:\n@@ -345,6 +354,10 @@ dummies:\nmultiple: true\npostfix: \"Select your favourite turtle(s).\"\ntaxonomy: [ groups, categories, tags, foobars ]\n+ record_template: test.twig\n+ listing_template: listing.twig\n+ listing_records: 10\n+\n# Possible field types:\n#\n" }, { "change_type": "ADD", "old_path": null, "new_path": "public/theme/skeleton/test.twig", "diff": "+{% extends 'partials/_master.twig' %}\n+\n+{% block main %}\n+\n+ <marquee>This template is for testing only! This template is for testing only! This template is for testing only!</marquee>\n+\n+ {% if record.hasField('title') %}\n+ <h1 class=\"title\">{{ record.title }}</h1>\n+ {% else %}\n+ <h1 class=\"heading\">{{ record|title }}</h1>\n+ {% endif %}\n+\n+ <hr>\n+\n+ <p class=\"text_markup_a\">{{ record.text_markup }}</p>\n+ <p class=\"text_markup_b\">{{ record.text_markup|raw }}</p>\n+ <p class=\"text_markup_c\">{{ record.text_markup|e('html') }}</p>\n+ <p class=\"text_markup_d\">{{ dump(record.text_markup.getValue())}}</p>\n+\n+ <p class=\"text_plain_a\">{{ record.text_plain }}</p>\n+ <p class=\"text_plain_b\">{{ record.text_plain|raw }}</p>\n+ <p class=\"text_plain_c\">{{ record.text_plain|e('html') }}</p>\n+ <p class=\"text_plain_d\">{{ dump(record.text_plain.getValue())}}</p>\n+\n+\n+ {% if record.hasField('image') %}\n+ <a href=\"{{ record.image }}\">\n+ <img src=\"{{ thumbnail(record.image, 400, 260) }}\">\n+ </a>\n+ <hr>\n+ {% endif %}\n+\n+ {# Output all fields, in the order as defined in the content type.\n+ To change the generated html and configure the options, see:\n+ https://docs.bolt.cm/templating #}\n+ {% with { 'record': record, 'common': true, 'extended': true, 'repeaters': true, 'blocks': true } %}\n+ {{ block('sub_fields', 'partials/_sub_fields.twig') }}\n+ {% endwith %}\n+\n+ {{ dump(record) }}\n+\n+ {% include 'partials/_recordfooter.twig' with { 'record': record, 'extended': true } %}\n+\n+{% endblock main %}\n" } ]
PHP
MIT License
bolt/core
Adding template.
95,144
10.03.2019 09:37:02
-3,600
91ac7819e12c9ccff76f8b95fc784d199398216c
Add template for testing
[ { "change_type": "MODIFY", "old_path": "public/theme/skeleton/test.twig", "new_path": "public/theme/skeleton/test.twig", "diff": "{% block main %}\n+ <style>\n+ .box {\n+ display: inline-block;\n+ border: 1px solid #CCC;\n+ padding: 0.5em;\n+ margin: 0.5em;\n+ }\n+ </style>\n+\n<marquee>This template is for testing only! This template is for testing only! This template is for testing only!</marquee>\n{% if record.hasField('title') %}\n<hr>\n- <p class=\"text_markup_a\">{{ record.text_markup }}</p>\n- <p class=\"text_markup_b\">{{ record.text_markup|raw }}</p>\n- <p class=\"text_markup_c\">{{ record.text_markup|e('html') }}</p>\n- <p class=\"text_markup_d\">{{ dump(record.text_markup.getValue())}}</p>\n+ <h2>Testing output with `allow_markup`</h2>\n+\n+ <p>\n+ Default output with <code>allow_markup: {{ record.text_markup.definition.allow_markup ? 'true' : 'false' }}</code>:<br>\n+ <span class=\"box text_markup_a\">{{ record.text_markup }}</span><br>\n+\n+ Explicit raw: <br>\n+ <span class=\"box text_markup_b\">{{ record.raw('text_markup') }}</span><br>\n+\n+ Escaped: <br>\n+ <span class=\"box text_markup_c\">{{ record.escape('text_markup') }}</span><br>\n+\n+ {{ dump(record.text_plain.getValue())}}\n+ </p>\n+\n+ <hr>\n+\n+ <p>\n+ Default output with <code>allow_markup: {{ record.text_plain.definition.allow_markup ? 'true' : 'false' }}</code>:<br>\n+ <span class=\"box text_plain_a\">{{ record.text_plain }}</span><br>\n+\n+ Explicit raw: <br>\n+ <span class=\"box text_plain_b\">{{ record.raw('text_plain') }}</span><br>\n- <p class=\"text_plain_a\">{{ record.text_plain }}</p>\n- <p class=\"text_plain_b\">{{ record.text_plain|raw }}</p>\n- <p class=\"text_plain_c\">{{ record.text_plain|e('html') }}</p>\n- <p class=\"text_plain_d\">{{ dump(record.text_plain.getValue())}}</p>\n+ Escaped: <br>\n+ <span class=\"box text_plain_c\">{{ record.escape('text_plain') }}</span><br>\n+ {{ dump(record.text_plain.getValue())}}\n+ </p>\n{% if record.hasField('image') %}\n<a href=\"{{ record.image }}\">\n" } ]
PHP
MIT License
bolt/core
Add template for testing
95,144
10.03.2019 09:42:34
-3,600
74b621d926cf87aea4711463192c71e9526df8a7
Make `allow_markup` work
[ { "change_type": "MODIFY", "old_path": "config/packages/twig.yaml", "new_path": "config/packages/twig.yaml", "diff": "twig:\ndebug: '%kernel.debug%'\nstrict_variables: true\n+ autoescape: false\nform_themes:\n- 'form/layout.twig'\n- 'form/fields.twig'\n" }, { "change_type": "MODIFY", "old_path": "src/Configuration/Parser/ContentTypesParser.php", "new_path": "src/Configuration/Parser/ContentTypesParser.php", "diff": "@@ -209,6 +209,10 @@ class ContentTypesParser extends BaseParser\n$hasGroups = true;\n}\n+ if (! isset($field['allow_markup'])) {\n+ $field['allow_markup'] = in_array($field['type'], ['html', 'markdown', 'textarea'], true);\n+ }\n+\n// Make sure we have these keys and every field has a group set.\n$field = array_replace(\n[\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/ContentExtrasTrait.php", "new_path": "src/Entity/ContentExtrasTrait.php", "diff": "@@ -71,4 +71,25 @@ trait ContentExtrasTrait\n'depublishedAt' => $content->getDepublishedAt(),\n];\n}\n+\n+ public function var_export(): string\n+ {\n+ $array = $this->getFieldValues();\n+\n+ return var_export($array, true);\n+ }\n+\n+ public function raw($fieldName): \\Twig_Markup\n+ {\n+ $output = implode('', $this->getField($fieldName)->getValue());\n+\n+ return new \\Twig_Markup($output, 'UTF-8');\n+ }\n+\n+ public function escape($fieldName): string\n+ {\n+ $output = implode('', $this->getField($fieldName)->getValue());\n+\n+ return htmlentities($output);\n+ }\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/Field.php", "new_path": "src/Entity/Field.php", "diff": "@@ -103,7 +103,13 @@ class Field implements Translatable\npublic function __toString(): string\n{\n- return implode(', ', $this->getValue());\n+ $stringValue = implode(', ', $this->getValue());\n+\n+ if (! $this->getDefinition()->get('allow_markup')) {\n+ $stringValue = htmlentities($stringValue);\n+ }\n+\n+ return $stringValue;\n}\npublic static function factory(LaravelCollection $definition, string $name = ''): self\n" } ]
PHP
MIT License
bolt/core
Make `allow_markup` work
95,144
10.03.2019 10:33:15
-3,600
44141a6fa75f794eca4000dbaa6f995053729202
Add Kakunin test
[ { "change_type": "ADD", "old_path": null, "new_path": "tests/e2e/features/display_record_test.feature", "diff": "+Feature: Test field output\n+\n+ Scenario: As a user I want to see how fields are escaped\n+\n+ When I visit the \"single_test\" page with parameters:\n+ | slug | title-of-the-test |\n+ Then I wait for \"title\" element to appear\n+\n+ And there is element \"text_markup_a\" with text \"Text with markup allowed.\"\n+ And there is element \"text_markup_b\" with text \"Text with markup allowed.\"\n+ And there is element \"text_markup_c\" with text \"Text with <em>markup allowed</em>.\"\n+\n+ And there is element \"text_plain_a\" with text \"Text with <strong>no</strong> markup allowed.\"\n+ And there is element \"text_plain_b\" with text \"Text with no markup allowed.\"\n+ And there is element \"text_plain_c\" with text \"Text with <strong>no</strong> markup allowed.\"\n" }, { "change_type": "ADD", "old_path": null, "new_path": "tests/e2e/pages/single_test.js", "diff": "+const { BasePage } = require('kakunin');\n+\n+class SingleTestPage extends BasePage {\n+ constructor() {\n+ super();\n+\n+ this.url = '/page/:slug';\n+\n+ this.title = $('h1.title');\n+ this.heading = $('h1.heading');\n+\n+ this.text_markup_a = $('.text_markup_a');\n+ this.text_markup_b = $('.text_markup_b');\n+ this.text_markup_c = $('.text_markup_c');\n+\n+ this.text_plain_a = $('.text_plain_a');\n+ this.text_plain_b = $('.text_plain_b');\n+ this.text_plain_c = $('.text_plain_c');\n+ }\n+}\n+\n+module.exports = SingleTestPage;\n\\ No newline at end of file\n" } ]
PHP
MIT License
bolt/core
Add Kakunin test
95,144
10.03.2019 10:45:39
-3,600
5b6c70ac7733dcf1bee72efcc682f5240845621f
Adding some typehints
[ { "change_type": "MODIFY", "old_path": "src/DataFixtures/ContentFixtures.php", "new_path": "src/DataFixtures/ContentFixtures.php", "diff": "@@ -4,6 +4,7 @@ declare(strict_types=1);\nnamespace Bolt\\DataFixtures;\n+use Bolt\\Collection\\DeepCollection;\nuse Bolt\\Configuration\\Config;\nuse Bolt\\Entity\\Content;\nuse Bolt\\Entity\\Field;\n@@ -103,14 +104,14 @@ class ContentFixtures extends Fixture implements DependentFixtureInterface\n}\n}\n- private function getRandomStatus()\n+ private function getRandomStatus(): string\n{\n$statuses = ['published', 'published', 'published', 'held', 'draft', 'timed'];\nreturn $statuses[array_rand($statuses)];\n}\n- private function getValuesforFieldType($name, $field)\n+ private function getValuesforFieldType(string $name, DeepCollection $field): array\n{\nswitch ($field['type']) {\ncase 'html':\n@@ -162,7 +163,7 @@ class ContentFixtures extends Fixture implements DependentFixtureInterface\nreturn $records;\n}\n- private function getPreset($slug): array\n+ private function getPreset(string $slug): array\n{\nif (isset($this->presetRecords[$slug]) && ! empty($this->presetRecords[$slug])) {\n$preset = array_pop($this->presetRecords[$slug]);\n" }, { "change_type": "MODIFY", "old_path": "src/Entity/ContentExtrasTrait.php", "new_path": "src/Entity/ContentExtrasTrait.php", "diff": "@@ -79,14 +79,14 @@ trait ContentExtrasTrait\nreturn var_export($array, true);\n}\n- public function raw($fieldName): \\Twig_Markup\n+ public function raw(string $fieldName): \\Twig_Markup\n{\n$output = implode('', $this->getField($fieldName)->getValue());\nreturn new \\Twig_Markup($output, 'UTF-8');\n}\n- public function escape($fieldName): string\n+ public function escape(string $fieldName): string\n{\n$output = implode('', $this->getField($fieldName)->getValue());\n" } ]
PHP
MIT License
bolt/core
Adding some typehints