Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ module compilé et n'est pas installable.

Vous pouvez également utiliser notre module ClassicBlocks, afin d'avoir 4 blocks à utiliser. Disponible ici: [Télécharger ClassicBlocks](https://github.com/PrestaSafe/classicblocks)

### Liste des pages CMS bloquée par le tri « Ouvrir dans PrettyBlocks »

Si le back-office affiche `Unknown column 'edit2'` sur la liste des pages,
ouvrez l'URL de cette liste avec le même compte et dans la même boutique.
Ajoutez `cms_page[orderBy]=position&cms_page[sortOrder]=asc` à ses paramètres
(`&` s'il y en a déjà, `?` sinon), en remplaçant les éventuelles valeurs de
tri existantes. PrestaShop mémorise ainsi un tri valide, sans intervention SQL.

## Validation des pull requests V3

Le [laboratoire de PR](docs/pr-validation.md) automatise la construction du ZIP,
Expand Down Expand Up @@ -92,6 +100,11 @@ and cannot be installed.

You can also add our module ClassicBlocks for having 4 blocks to use [Download ClassicBlocks](https://github.com/PrestaSafe/classicblocks)

If the CMS pages list is already blocked by `Unknown column 'edit2'`, open it
as the affected employee in the affected shop and set the URL parameters
`cms_page[orderBy]=position&cms_page[sortOrder]=asc`. This replaces the saved
sort using PrestaShop's normal grid behavior, without editing the database.

## Compatible Themes

Discover our [PrestaShop SEO / Performance and Mobile Optimized Theme: CartZilla](https://www.prestasafe.com/product/theme-prestashop-cartzilla) compatible PrettyBlocks !
Expand Down
1 change: 1 addition & 0 deletions scripts/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ docker compose "${compose_files[@]}" up \

for service in ps82 ps91; do
for fixture_and_target in \
'admin-grid-button-test:src/Core/Grid/Column/Type/PrettyBlocksButtonColumn.php' \
'field-fileupload-test:classes/prettyblocks/core/FieldCore.php' \
'date-field-test:classes/prettyblocks/core/FieldCore.php' \
'editor-cache-test:prettyblocks.php'; do
Expand Down
1 change: 1 addition & 0 deletions src/Core/Grid/Column/Type/PrettyBlocksButtonColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ protected function configureOptions(OptionsResolver $resolver)
parent::configureOptions($resolver);
$resolver
->setDefaults([
'sortable' => false,
'icon' => null,
'route_fragment' => null,
'button_template' => false,
Expand Down
31 changes: 31 additions & 0 deletions tests/admin-grid-button-test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use PrestaSafe\PrettyBlocks\Core\Grid\Column\Type\PrettyBlocksButtonColumn;
use PrestaShop\PrestaShop\Core\Grid\Column\Type\DataColumn;

require '/var/www/html/vendor/autoload.php';
require $argv[1];

foreach (['cms' => 'id_cms', 'category' => 'id_category', 'product' => 'id_product'] as $endpoint => $field) {
$column = (new PrettyBlocksButtonColumn('edit2'))->setOptions([
'field' => $field,
'route' => 'admin_prettyblocks',
'route_param_name' => 'id',
'route_param_field' => $field,
'endpoint' => $endpoint,
]);
$options = $column->getOptions();
if ($options['sortable'] !== false) {
throw new RuntimeException(sprintf('The %s action column is not a sortable database field.', $endpoint));
}
if ($options['route'] !== 'admin_prettyblocks' || $options['route_param_field'] !== $field) {
throw new RuntimeException(sprintf('The %s action must still link to PrettyBlocks.', $endpoint));
}
}

$title = (new DataColumn('meta_title'))->setOptions(['field' => 'meta_title']);
if ($title->getOptions()['sortable'] !== true) {
throw new RuntimeException('Ordinary data columns must remain sortable.');
}

echo "PrettyBlocks grid button options passed.\n";