Skip to content

Commit f85bd34

Browse files
authored
Merge pull request #2133 from MAX-IT-Tech/feat/links-line-anchors-910
Pin line-anchored GitHub links to the 9.1.0 tag
2 parents 095fced + fba56eb commit f85bd34

26 files changed

Lines changed: 102 additions & 77 deletions

development/components/database/objectmodel.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Field type is an important setting, it determines how ObjectModel will format yo
166166
#### Validation rules reference
167167

168168
Several validation rules are available for your ObjectModel fields.
169-
[Please refer to the Validate class of PrestaShop](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/classes/Validate.php) for a complete list.
169+
[Please refer to the Validate class of PrestaShop](https://github.com/PrestaShop/PrestaShop/blob/9.1.x/classes/Validate.php) for a complete list.
170170

171171
### Add timestamps to your entity (date_add and date_upd)
172172

@@ -208,7 +208,7 @@ $cms->save();
208208

209209
In this example, we create an entity from scratch. Then, we set its `position` attribute, and we call the `save()` method. The `save()` method will trigger the `add()` method since its `id` attribute is not yet known (because the entity is not created in database).
210210

211-
If the insert is successful, the ObjectModel class will set the entity's id (retrieved from the database). [Complete reference here](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/classes/ObjectModel.php#L572-L658).
211+
If the insert is successful, the ObjectModel class will set the entity's id (retrieved from the database). [Complete reference here](https://github.com/PrestaShop/PrestaShop/blob/9.1.0/classes/ObjectModel.php#L483-L576).
212212

213213

214214
### Load and save an object
@@ -221,7 +221,7 @@ $cms->position = 3;
221221
$cms->save();
222222
```
223223

224-
In this example, we retrieve an entity from the database with its id. Then, we change its `position` attribute and call the same `save()` method. The `save()` method will trigger the `update()` method and not the `add()` method since its `id` attribute is known. [Complete reference here](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/classes/ObjectModel.php#L750-L868).
224+
In this example, we retrieve an entity from the database with its id. Then, we change its `position` attribute and call the same `save()` method. The `save()` method will trigger the `update()` method and not the `add()` method since its `id` attribute is known. [Complete reference here](https://github.com/PrestaShop/PrestaShop/blob/9.1.0/classes/ObjectModel.php#L671-L750).
225225

226226
### Hard or soft delete an object
227227

@@ -572,7 +572,7 @@ public function hookActionObjectProductDeleteAfter(Product $product)
572572

573573
Here is the reference of the methods described on this page. Many other methods that we don't described here are available.
574574

575-
See complete implementation here : [ObjectModel.php](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/classes/ObjectModel.php)
575+
See complete implementation here : [ObjectModel.php](https://github.com/PrestaShop/PrestaShop/blob/9.1.x/classes/ObjectModel.php)
576576

577577
```php
578578
/**

development/components/form/types-reference/amount-currency.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: AmountCurrencyType
77
Amount with currency: combination of a `NumberType` input and a `ChoiceType` input (for currency selection).
88

99
- Namespace: `PrestaShopBundle\Form\Admin\Type`
10-
- Reference: [AmountCurrencyType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Type/AmountCurrencyType.php)
10+
- Reference: [AmountCurrencyType](https://github.com/PrestaShop/PrestaShop/blob/9.1.x/src/PrestaShopBundle/Form/Admin/Type/AmountCurrencyType.php)
1111

1212
## Type options
1313

@@ -20,7 +20,7 @@ Amount with currency: combination of a `NumberType` input and a `ChoiceType` inp
2020

2121
## Code example
2222

23-
- [OrderPaymentType.php](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Sell/Order/OrderPaymentType.php#L113-L122)
23+
- [OrderPaymentType.php](https://github.com/PrestaShop/PrestaShop/blob/9.1.0/src/PrestaShopBundle/Form/Admin/Sell/Order/OrderPaymentType.php#L93-L106)
2424

2525
```php
2626
$builder

development/components/form/types-reference/button-collection.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: ButtonCollectionType
77
`ButtonCollectionType` is a form type used to group buttons in a common form group, which is useful for forms that have multiple submit buttons.
88

99
- Namespace: `PrestaShopBundle\Form\Admin\Type`
10-
- Reference: [ButtonCollectionType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Type/ButtonCollectionType.php)
10+
- Reference: [ButtonCollectionType](https://github.com/PrestaShop/PrestaShop/blob/9.1.x/src/PrestaShopBundle/Form/Admin/Type/ButtonCollectionType.php)
1111

1212
## Type options
1313

@@ -20,14 +20,15 @@ title: ButtonCollectionType
2020

2121
## Code example
2222

23-
- [CombinationItemType.php](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Sell/Product/Combination/CombinationItemType.php#L150-L183)
23+
- [CombinationItemType.php](https://github.com/PrestaShop/PrestaShop/blob/9.1.0/src/PrestaShopBundle/Form/Admin/Sell/Product/Combination/CombinationItemType.php#L128-L222)
2424

2525
```php
2626
$builder->add('actions', ButtonCollectionType::class, [
2727
'buttons' => [
2828
'edit' => [
2929
'type' => IconButtonType::class,
3030
'options' => [
31+
'label' => $this->trans('Edit', 'Admin.Actions'),
3132
'icon' => 'mode_edit',
3233
'attr' => [
3334
'class' => 'edit-combination-item tooltip-link',
@@ -39,6 +40,7 @@ $builder->add('actions', ButtonCollectionType::class, [
3940
'delete' => [
4041
'type' => IconButtonType::class,
4142
'options' => [
43+
'label' => $this->trans('Delete', 'Admin.Actions'),
4244
'icon' => 'delete',
4345
'attr' => [
4446
'class' => 'delete-combination-item tooltip-link',
@@ -48,6 +50,7 @@ $builder->add('actions', ButtonCollectionType::class, [
4850
'data-modal-cancel' => $this->trans('Cancel', 'Admin.Actions'),
4951
'data-toggle' => 'pstooltip',
5052
'data-original-title' => $this->trans('Delete', 'Admin.Actions'),
53+
'data-shop-id' => $this->contextShopId,
5154
],
5255
],
5356
],
@@ -56,6 +59,8 @@ $builder->add('actions', ButtonCollectionType::class, [
5659
'attr' => [
5760
'class' => 'combination-row-actions',
5861
],
62+
'inline_buttons_limit' => self::INLINE_ACTIONS_LIMIT,
63+
'use_inline_labels' => false,
5964
])
6065
```
6166

development/components/form/types-reference/color-picker-type.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: ColorPickerType
77
This form class is responsible for creating a color picker field
88

99
- Namespace: PrestaShopBundle\Form\Admin\Type
10-
- Reference: [ColorPickerType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Type/ColorPickerType.php)
10+
- Reference: [ColorPickerType](https://github.com/PrestaShop/PrestaShop/blob/9.1.x/src/PrestaShopBundle/Form/Admin/Type/ColorPickerType.php)
1111

1212
## Type options
1313

@@ -16,11 +16,13 @@ This form class is responsible for creating a color picker field
1616

1717
## Code example
1818

19-
- [OrderStateType.php](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Configure/ShopParameters/OrderStates/OrderStateType.php#L132-L134)
19+
- [OrderStateType.php](https://github.com/PrestaShop/PrestaShop/blob/9.1.0/src/PrestaShopBundle/Form/Admin/Configure/ShopParameters/OrderStates/OrderStateType.php#L158-L162)
2020

2121
```php
2222
$builder->add('color', ColorPickerType::class, [
23-
'required' => true,
23+
'required' => false,
24+
'label' => $this->trans('Color', 'Admin.Shopparameters.Feature'),
25+
'help' => $this->trans('Background color of this status label. Used both in backoffice and on order tracking page. HTML colors only.', 'Admin.Shopparameters.Help'),
2426
])
2527
```
2628

development/components/form/types-reference/configurable-country-choice-type.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: ConfigurableCountryChoiceType
77
Class responsible for providing configurable countries list
88

99
- Namespace: PrestaShopBundle\Form\Admin\Type
10-
- Reference: [ConfigurableCountryChoiceType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Type/ConfigurableCountryChoiceType.php)
10+
- Reference: [ConfigurableCountryChoiceType](https://github.com/PrestaShop/PrestaShop/blob/9.1.x/src/PrestaShopBundle/Form/Admin/Type/ConfigurableCountryChoiceType.php)
1111

1212
## Type options
1313

@@ -16,7 +16,7 @@ Class responsible for providing configurable countries list
1616

1717
## Code example
1818

19-
- [StateGridDefinitionFactory.php](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/Core/Grid/Definition/Factory/StateGridDefinitionFactory.php#L210-L218)
19+
- [StateGridDefinitionFactory.php](https://github.com/PrestaShop/PrestaShop/blob/9.1.0/src/Core/Grid/Definition/Factory/StateGridDefinitionFactory.php#L191-L199)
2020

2121
```php
2222
$builder->add(

development/components/form/types-reference/custom-content-type.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: CustomContentType
77
Type is used to add any content at any position of the form, rather than the actual field.
88

99
- Namespace: PrestaShopBundle\Form\Admin\Type
10-
- Reference: [CustomContentType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Type/CustomContentType.php)
10+
- Reference: [CustomContentType](https://github.com/PrestaShop/PrestaShop/blob/9.1.x/src/PrestaShopBundle/Form/Admin/Type/CustomContentType.php)
1111

1212
## Type options
1313

@@ -16,7 +16,7 @@ Type is used to add any content at any position of the form, rather than the act
1616

1717
## Code example
1818

19-
- [CmsPageType.php](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Improve/Design/Pages/CmsPageType.php#L142-L149)
19+
- [CmsPageType.php](https://github.com/PrestaShop/PrestaShop/blob/9.1.0/src/PrestaShopBundle/Form/Admin/Improve/Design/Pages/CmsPageType.php#L120-L130)
2020

2121
```php
2222
$builder->add('seo_preview', CustomContentType::class, [
@@ -26,6 +26,9 @@ $builder->add('seo_preview', CustomContentType::class, [
2626
'data' => [
2727
'cms_url' => $options['cms_preview_url'],
2828
],
29+
'row_attr' => [
30+
'class' => 'seo_preview',
31+
],
2932
])
3033
```
3134

development/components/form/types-reference/delta-quantity-type.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: DeltaQuantityType
77
Quantity field that displays the initial quantity (not editable) and allows editing with delta quantity instead (ex: +5, -8). The input data of this form type is the initial (as a plain integer) however, its output on submit is the delta quantity.
88

99
- Namespace: PrestaShopBundle\Form\Admin\Type
10-
- Reference: [DeltaQuantityType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Type/DeltaQuantityType.php)
10+
- Reference: [DeltaQuantityType](https://github.com/PrestaShop/PrestaShop/blob/9.1.x/src/PrestaShopBundle/Form/Admin/Type/DeltaQuantityType.php)
1111

1212
## Type options
1313

@@ -16,7 +16,7 @@ Quantity field that displays the initial quantity (not editable) and allows edit
1616

1717
## Code example
1818

19-
- [BulkCombinationStockType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Sell/Product/Combination/BulkCombinationStockType.php#L78-L86)
19+
- [BulkCombinationStockType](https://github.com/PrestaShop/PrestaShop/blob/9.1.0/src/PrestaShopBundle/Form/Admin/Sell/Product/Combination/BulkCombinationStockType.php#L52-L61)
2020

2121
```php
2222
$builder->add('delta_quantity', DeltaQuantityType::class, [
@@ -27,6 +27,7 @@ $builder->add('delta_quantity', DeltaQuantityType::class, [
2727
'disabled_value' => function (?array $data) {
2828
return empty($data['quantity']) && empty($data['delta']);
2929
},
30+
'modify_all_shops' => true,
3031
])
3132
```
3233

development/components/form/types-reference/email-type.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: EmailType
77
Symfony native EmailType extended with IDNConverter (InternationalizedDomainNameConverter) feature
88

99
- Namespace: PrestaShopBundle\Form\Admin\Type
10-
- Reference: [EmailType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Type/EmailType.php)
10+
- Reference: [EmailType](https://github.com/PrestaShop/PrestaShop/blob/9.1.x/src/PrestaShopBundle/Form/Admin/Type/EmailType.php)
1111

1212
## Type options
1313

@@ -16,10 +16,11 @@ Symfony native EmailType extended with IDNConverter (InternationalizedDomainName
1616

1717
## Code example
1818

19-
- [EmployeeType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Configure/AdvancedParameters/Employee/EmployeeType.php#L136-L144)
19+
- [EmployeeType](https://github.com/PrestaShop/PrestaShop/blob/9.1.0/src/PrestaShopBundle/Form/Admin/Configure/AdvancedParameters/Employee/EmployeeType.php#L140-L149)
2020

2121
```php
2222
$builder->add('email', EmailType::class, [
23+
'label' => $this->trans('Email address', [], 'Admin.Global'),
2324
'constraints' => [
2425
$this->getNotBlankConstraint(),
2526
$this->getLengthConstraint(EmployeeEmail::MAX_LENGTH),

development/components/form/types-reference/entity-search-input-type.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: EntitySearchInputType
77
This form type is used for an OneToMany (or ManyToMany) association, it allows to search a list of entities (based on a remote URL) and associate it. It is based on the CollectionType form type which provides prototype features to display a custom template for each associated item.
88

99
- Namespace: PrestaShopBundle\Form\Admin\Type
10-
- Reference: [EntitySearchInputType](https://github.com/PrestaShop/PrestaShop/blob/9.0.x/src/PrestaShopBundle/Form/Admin/Type/EntitySearchInputType.php)
10+
- Reference: [EntitySearchInputType](https://github.com/PrestaShop/PrestaShop/blob/9.1.x/src/PrestaShopBundle/Form/Admin/Type/EntitySearchInputType.php)
1111

1212
## Type options
1313

@@ -30,7 +30,7 @@ Learn more about [JavaScript components and how to use them]({{<relref "/9/devel
3030

3131
## Code example
3232

33-
- [RedirectOptionType](https://github.com/PrestaShop/PrestaShop/blob/9.0.x/src/PrestaShopBundle/Form/Admin/Sell/Category/SEO/RedirectOptionType.php#L86-L96)
33+
- [RedirectOptionType](https://github.com/PrestaShop/PrestaShop/blob/9.1.0/src/PrestaShopBundle/Form/Admin/Sell/Category/SEO/RedirectOptionType.php#L66-L76)
3434

3535
```php
3636
$builder
@@ -63,7 +63,7 @@ let searchInput = new window.prestashop.component.EntitySearchInput(elementId, {
6363
},
6464
onSelectedContent: () => {
6565
console.log('Event on product selection');
66-
}
66+
},
6767
});
6868
```
6969

development/components/form/types-reference/icon-button-type.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: IconButtonType
77
A form button with material icon.
88

99
- Namespace: PrestaShopBundle\Form\Admin\Type
10-
- Reference: [IconButtonType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Type/IconButtonType.php)
10+
- Reference: [IconButtonType](https://github.com/PrestaShop/PrestaShop/blob/9.1.x/src/PrestaShopBundle/Form/Admin/Type/IconButtonType.php)
1111

1212
## Type options
1313

@@ -18,18 +18,26 @@ A form button with material icon.
1818

1919
## Code example
2020

21-
- [FooterType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Sell/Product/FooterType.php#L99-L107)
21+
- [FooterType](https://github.com/PrestaShop/PrestaShop/blob/9.1.0/src/PrestaShopBundle/Form/Admin/Sell/Product/FooterType.php#L102-L116)
2222

2323
```php
24-
$builder->add('catalog', IconButtonType::class, [
25-
'label' => $this->trans('Go to catalog', 'Admin.Catalog.Feature'),
26-
'type' => 'link',
27-
'icon' => 'arrow_back_ios',
28-
'attr' => [
29-
'class' => 'btn-outline-secondary border-white go-to-catalog-button',
30-
'href' => $this->router->generate('admin_products_v2_index', ['offset' => 'last', 'limit' => 'last']),
31-
],
32-
])
24+
$builder
25+
->add('actions', ButtonCollectionType::class, [
26+
'buttons' => [
27+
'catalog' => [
28+
'type' => IconButtonType::class,
29+
'options' => [
30+
'label' => $this->trans('Go to catalog', 'Admin.Catalog.Feature'),
31+
'type' => 'link',
32+
'icon' => 'arrow_back_ios',
33+
'attr' => [
34+
'class' => 'btn-outline-secondary go-to-catalog-button',
35+
'href' => $this->router->generate('admin_products_index', ['offset' => 'last', 'limit' => 'last']),
36+
],
37+
],
38+
],
39+
],
40+
])
3341
```
3442

3543
## Preview example

0 commit comments

Comments
 (0)