Skip to content

Commit

Permalink
Merge branch '5.1' of github.com:bolt/core into 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bobdenotter committed Jan 31, 2023
2 parents 3f40b8b + 45c30eb commit f199197
Show file tree
Hide file tree
Showing 24 changed files with 4,390 additions and 23,886 deletions.
59 changes: 57 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,61 @@
Changelog
=========

## 5.1.21

Released: 2023-01-27

### 🐛 Bug fixes

- Fix PHPStan errors (on PHP 8.x) #3395

## 5.1.20

Released: 2023-01-20

### 🐛 Bug fixes

- Do not display twig value for SetField #3390


## 5.1.19

Released: 2022-12-08

### 🐛 Bug fixes

- Pass other `_route_params` into a forwarded request #3342
- Fix excerpt when content would be too short _after_ trimming #3367
- Make `guesstimateAuthor` return type nullable #3358
- Made the `isCurrent`-filter remove the current locale #3368


## 5.1.18

Released: 2022-10-28

### 🐛 Bug fixes

- Create fix-bundles as bash script #3340
- Since we call it using `self::runPHP`, we don't need the shebang #3337
- Fixed some typos and made some phrases more natural/native sounding #3338
- Pass other `_route_params` into a forwarded request #3342

### 📦 Additions and new features

- Added Ukrainian lang support, fixed some Russian translations #3339

## 5.1.17

Released: 2022-10-14

### 🐛 Bug fixes

- Ensure we return the found `ImageField`, and not the surrounding `Set` or `Collection` #3333
- Fix `fix-bundles` in `PostUpdateScript.php` #3331
- Allow editing `YAML` files through the Bolt Backend #3325
- Check for empty request before using it #3334

## 5.1.16

Released: 2022-09-21
Expand Down Expand Up @@ -42,8 +97,8 @@ Released: 2022-08-31

Released: 2022-08-26

This release includes three security-related fixes. Our thanks go out to Eitan
Shav at [WhiteSource](https://whitesourcesoftware.com) and David Müller of
This release includes three security-related fixes. Our thanks go out to Eitan
Shav at [WhiteSource](https://whitesourcesoftware.com) and David Müller of
[lutrasecurity.com](https://lutrasecurity.com/) for identifying these issues and
disclosing them to us responsibly! 👏🙏

Expand Down
2 changes: 1 addition & 1 deletion assets/js/version.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// generated by genversion
export const version = '5.1.14';
export const version = '5.1.20';
2 changes: 1 addition & 1 deletion bin/composer-script/PostUpdateScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static function execute(): void
{
parent::init('Running composer "post-update-cmd" scripts');

self::runPHP(['vendor/bolt/core/bin/fix-bundles.php']);
self::runPHP(['vendor/bolt/core/bin/fix-bundles']);
self::runPHP(['vendor/bobdenotter/yaml-migrations/bin/yaml-migrate', 'process', '-c', 'vendor/bolt/core/yaml-migrations/config.yaml', '-v']);
self::runConsole(['cache:clear', '--no-warmup', '--ansi']);
self::runConsole(['assets:install', '--symlink', '--relative', 'public', '--ansi']);
Expand Down
4 changes: 4 additions & 0 deletions bin/fix-bundles
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env php
<?php

require __DIR__ . '/fix-bundles.php';
1 change: 0 additions & 1 deletion bin/fix-bundles.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env php
<?php

use Symfony\Component\VarExporter\VarExporter;
Expand Down
24,936 changes: 1,125 additions & 23,811 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bolt",
"version": "5.1.16",
"version": "5.1.20",
"homepage": "https://boltcms.io",
"author": "Bob den Otter <[email protected]> (https://boltcms.io)",
"license": "MIT",
Expand Down
5 changes: 4 additions & 1 deletion src/Controller/Frontend/ListingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ public function listing(ContentRepository $contentRepository, string $contentTyp
$route = $content->getDefinition()->get('record_route');
$controller = $this->container->get('router')->getRouteCollection()->get($route)->getDefault('_controller');

return $this->forward($controller, ['slugOrId' => $content->getId()]);
$parameters = $this->request->attributes->all();
$parameters['slugOrId'] = $content->getId();

return $this->forward($controller, $parameters);
}

$records = $this->setRecords($content, $amountPerPage, $page);
Expand Down
3 changes: 2 additions & 1 deletion src/Entity/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Bolt\Configuration\Content\ContentType;
use Bolt\Entity\Field\Excerptable;
use Bolt\Entity\Field\ScalarCastable;
use Bolt\Entity\Field\SetField;
use Bolt\Enum\Statuses;
use Bolt\Repository\FieldRepository;
use DateTimeZone;
Expand Down Expand Up @@ -699,7 +700,7 @@ public function __call(string $name, array $arguments = [])
throw new \RuntimeException(sprintf('Invalid field name or method call on %s: %s', $this->__toString(), $name));
}

if ($field instanceof Excerptable || $field instanceof ScalarCastable) {
if (!$field instanceof SetField && ($field instanceof Excerptable || $field instanceof ScalarCastable)) {
return $field->getTwigValue();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Field/CollectionField.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* @ORM\Entity
*/
class CollectionField extends Field implements Excerptable, FieldInterface, FieldParentInterface, ListFieldInterface, \Iterator, RawPersistable
class CollectionField extends Field implements Excerptable, FieldInterface, FieldParentInterface, ListFieldInterface, RawPersistable
{
use FieldParentTrait;
use IterableFieldTrait;
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Field/FilelistField.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @ORM\Entity
*/
class FilelistField extends Field implements FieldInterface, ListFieldInterface, RawPersistable, \Iterator
class FilelistField extends Field implements FieldInterface, ListFieldInterface, RawPersistable
{
use IterableFieldTrait;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Field/ImagelistField.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @ORM\Entity
*/
class ImagelistField extends Field implements FieldInterface, ListFieldInterface, RawPersistable, \Iterator
class ImagelistField extends Field implements FieldInterface, ListFieldInterface, RawPersistable
{
use IterableFieldTrait;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Field/SelectField.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @ORM\Entity
*/
class SelectField extends Field implements FieldInterface, RawPersistable, \Iterator
class SelectField extends Field implements FieldInterface, RawPersistable
{
use IterableFieldTrait;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Field/SetField.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* @ORM\Entity
*/
class SetField extends Field implements Excerptable, FieldInterface, FieldParentInterface, ListFieldInterface, \Iterator, RawPersistable
class SetField extends Field implements Excerptable, FieldInterface, FieldParentInterface, ListFieldInterface, RawPersistable
{
use FieldParentTrait;
use IterableFieldTrait;
Expand Down
2 changes: 1 addition & 1 deletion src/Event/Listener/ContentFillListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function fillContent(Content $entity): void
$entity->setContentExtension($this->contentExtension);
}

private function guesstimateAuthor(): User
private function guesstimateAuthor(): ?User
{
return $this->users->getFirstAdminUser();
}
Expand Down
7 changes: 5 additions & 2 deletions src/Security/AuthenticationEntryPointRedirector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
Expand All @@ -21,10 +22,12 @@ public function __construct(TranslatorInterface $translator, UrlGeneratorInterfa
$this->urlGenerator = $urlGenerator;
}

public function start(Request $request, AuthenticationException $authException = null)
public function start(Request $request, AuthenticationException $authException = null): RedirectResponse
{
// add a custom flash message and redirect to the login page
$request->getSession()->getFlashBag()->add('warning', $this->translator->trans('You have to login in order to access this page.', [], 'security'));
/** @var Session $session */
$session = $request->getSession();
$session->getFlashBag()->add('warning', $this->translator->trans('You have to login in order to access this page.', [], 'security'));

return new RedirectResponse($this->urlGenerator->generate('bolt_login'));
}
Expand Down
1 change: 1 addition & 0 deletions src/Utils/Excerpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ protected static function extractRelevant($words, string $fulltext, int $relLeng
// if we are going to snip too much...
if ($textlength - $startPos < $relLength) {
$startPos -= (int) round(($textlength - $startPos) / 2);
$startPos = max(0, $startPos);
}

$relText = mb_substr($fulltext, $startPos, $relLength);
Expand Down
2 changes: 1 addition & 1 deletion src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class Version
* Stable — 3.0.0
* Development — 3.1.0 alpha 1
*/
public const VERSION = '5.1.16';
public const VERSION = '5.1.21';
public const CODENAME = '';

/**
Expand Down
4 changes: 4 additions & 0 deletions src/Widget/Injector/RequestZone.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public static function is(Request $request, string $value): bool
*/
public static function getFromRequest(?Request $request): string
{
if (!$request) {
return static::NOWHERE;
}

return $request->attributes->get(static::KEY) ?: static::NOWHERE;
}

Expand Down
20 changes: 10 additions & 10 deletions translations/messages.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</notes>
<segment>
<source>http_error.description</source>
<target>There was an unknown error (HTTP %status_code%) that prevented to complete your request.</target>
<target>There was an unknown error (HTTP %status_code%) that prevented your request being completed.</target>
</segment>
</unit>
<unit id="ru5FEGk" name="http_error.suggestion">
Expand All @@ -37,7 +37,7 @@
</notes>
<segment>
<source>http_error.suggestion</source>
<target><![CDATA[Try loading this page again in some minutes or <a href="%url%">go back to the homepage</a>.]]></target>
<target><![CDATA[Try loading this page again in a few minutes or <a href="%url%">go back to the homepage</a>.]]></target>
</segment>
</unit>
<unit id="Qn5rwdU" name="http_error_403.description">
Expand All @@ -46,7 +46,7 @@
</notes>
<segment>
<source>http_error_403.description</source>
<target>You don't have permission to access to this resource.</target>
<target>You don't have permission to access this resource.</target>
</segment>
</unit>
<unit id="zDeeh7L" name="http_error_403.suggestion">
Expand All @@ -73,7 +73,7 @@
</notes>
<segment>
<source>http_error_404.suggestion</source>
<target><![CDATA[Check out any misspelling in the URL or <a href="%url%">go back to the homepage</a>.]]></target>
<target><![CDATA[Check for any misspelling in the URL or <a href="%url%">go back to the homepage</a>.]]></target>
</segment>
</unit>
<unit id="ZYXSW95" name="http_error_500.description">
Expand All @@ -91,7 +91,7 @@
</notes>
<segment>
<source>http_error_500.suggestion</source>
<target><![CDATA[Try loading this page again in some minutes or <a href="%url%">go back to the homepage</a>.]]></target>
<target><![CDATA[Try loading this page again in a few minutes or <a href="%url%">go back to the homepage</a>.]]></target>
</segment>
</unit>
<unit id="9RwuNlf" name="title.source_code">
Expand Down Expand Up @@ -455,7 +455,7 @@
</notes>
<segment>
<source>user.updated_successfully</source>
<target>Updated Sucessfully</target>
<target>Updated Successfully</target>
</segment>
</unit>
<unit id="3hkt.eH" name="content.updated_successfully">
Expand Down Expand Up @@ -972,7 +972,7 @@
<unit id="2MMvCKK" name="label.cache_cleared">
<segment>
<source>label.cache_cleared</source>
<target>Cache cleared succesfully!</target>
<target>Cache cleared successfully!</target>
</segment>
</unit>
<unit id="Wou02nK" name="caption.kitchensink">
Expand Down Expand Up @@ -1080,7 +1080,7 @@
<unit id="Iyry5.g" name="editfile.updated_successfully">
<segment>
<source>editfile.updated_successfully</source>
<target>File updated succesfully!</target>
<target>File updated successfully!</target>
</segment>
</unit>
<unit id="3zlZmRK" name="action.add_user">
Expand Down Expand Up @@ -2460,7 +2460,7 @@
<unit id="SwOgM7K" name="reset_password.request_description">
<segment>
<source>reset_password.request_description</source>
<target>Enter your email address and we we will send you a link to reset your password.</target>
<target>Enter your email address and we will send you a link to reset your password.</target>
</segment>
</unit>
<unit id="RX0Iuzi" name="reset_password.request_send">
Expand Down Expand Up @@ -2496,7 +2496,7 @@
<unit id="SxW1D3L" name="reset_password.check_email_sent_text_1">
<segment>
<source>reset_password.check_email_sent_text_1</source>
<target>An email has been sent that contains a link that you can click to reset your password. This link will expire in %hours% hour(s).</target>
<target>An email has been sent that contains a link you can click to reset your password. This link will expire in %hours% hour(s).</target>
</segment>
</unit>
<unit id="z25k4DS" name="reset_password.check_email_sent_text_2">
Expand Down
12 changes: 6 additions & 6 deletions translations/messages.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@
<unit id="ZJxfdD6" name="listing_table.actions.status_to_held">
<segment>
<source>listing_table.actions.status_to_held</source>
<target>Изменить статус на "не активно"</target>
<target>Изменить статус на "неактивно"</target>
</segment>
</unit>
<unit id="apyOs0o" name="listing_table.actions.status_to_draft">
Expand Down Expand Up @@ -1860,7 +1860,7 @@
<unit id="Sd_AbmV" name="field.cropXPostfix">
<segment>
<source>field.cropXPostfix</source>
<target>Положение кадрирования по оси X, диапазон 0-100.</target>
<target>Положение кадрирования по оси X, диапазон 0-100.</target>
</segment>
</unit>
<unit id="BQBmQHT" name="field.cropYPostfix">
Expand Down Expand Up @@ -2136,7 +2136,7 @@
<unit id="3MuwWwe" name="listing.disabled">
<segment>
<source>listing.disabled</source>
<target>Вывод отклчен</target>
<target>Вывод отключен</target>
</segment>
</unit>
<unit id="XQ2U6fN" name="slug.button_unlocked">
Expand Down Expand Up @@ -2286,7 +2286,7 @@
<unit id="JpJFIFq" name="collection.confirm_delete">
<segment>
<source>collection.confirm_delete</source>
<target>Вы действительно хотите удалить эту элемент коллекции?</target>
<target>Вы действительно хотите удалить этот элемент коллекции?</target>
</segment>
</unit>
<unit id="YZJO3Ul" name="upload.allow_file_types">
Expand Down Expand Up @@ -2352,7 +2352,7 @@
<unit id="pXtciRI" name="content.edit_missing_definition">
<segment>
<source>content.edit_missing_definition</source>
<target>Определение этого Типа контента отсутствует! Редактирование этой записи не будет работать должным образом. Пожалуйста, проверьте свой contenttypes.yaml, чтобы убедиться, что он содержит% contenttype%.</target>
<target>Определение этого Типа контента отсутствует! Редактирование этой записи не будет работать должным образом. Пожалуйста, проверьте свой contenttypes.yaml, чтобы убедиться, что он содержит% contenttype%.</target>
</segment>
</unit>
<unit id="RBJ0NMl" name="collection.select">
Expand All @@ -2370,7 +2370,7 @@
<unit id="5Qf_RiO" name="form.empty_password">
<segment>
<source>form.empty_password</source>
<target>Пожалуйста введите ваш пароль</target>
<target>Пожалуйста, введите ваш пароль</target>
</segment>
</unit>
<unit id="fAmcKUQ" name="listing.title_filterby_field">
Expand Down
Loading

0 comments on commit f199197

Please sign in to comment.