Skip to content

Commit

Permalink
bug Sylius#13750 [Admin][Shop] placehold.it replaced to local placeho…
Browse files Browse the repository at this point in the history
…lders (ernestWarwas)

This PR was merged into the 1.9 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | 1.9
| Bug fix?        | yes
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| License         | MIT

According to problems with uptime with placeholder.com we decided to replace it with local placeholders.

https://www.saashub.com/placeholder-com-status

<!--
 - Bug fixes must be submitted against the 1.10 or 1.11 branch(the lowest possible)
 - Features and deprecations must be submitted against the master branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->


Commits
-------

931d350 [Admin][Shop] placehold.it replaced to local placeholders
9ec1c11 fix asset path
  • Loading branch information
GSadee authored Mar 10, 2022
2 parents 9460236 + 9ec1c11 commit 1bdbddd
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Sylius/Behat/Element/Admin/TopBarElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function hasAvatarInMainBar(string $avatarPath): bool

public function hasDefaultAvatarInMainBar(): bool
{
return strpos($this->getAvatarImagePath(), '//placehold.it/50x50') !== false;
return strpos($this->getAvatarImagePath(), '/assets/admin/img/50x50.png') !== false;
}

private function getAvatarImagePath(): string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if app.user.avatar is not empty and app.user.avatar.path is not empty %}
{% set path = app.user.avatar.path|imagine_filter('sylius_admin_admin_user_avatar_thumbnail') %}
{% else %}
{% set path = '//placehold.it/50x50' %}
{% set path = asset('assets/admin/img/50x50.png') %}
{% endif %}

<img style="margin-right: 10px;" class="ui avatar image" src="{{ path }}">
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% elseif product.images.first %}
{% set path = product.images.first.path|imagine_filter(filter|default('sylius_admin_product_thumbnail')) %}
{% else %}
{% set path = '//placehold.it/200x200' %}
{% set path = asset('assets/admin/img/200x200.png') %}
{% endif %}

<img src="{{ path }}" alt="{{ product.name }}" class="ui bordered image" />
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% if product.images|length >= 1 %}
<div class="ui small images">
{% for image in product.images %}
{% set path = image.path is not null ? image.path|imagine_filter('sylius_admin_product_small_thumbnail') : '//placehold.it/200x200' %}
{% set path = image.path is not null ? image.path|imagine_filter('sylius_admin_product_small_thumbnail') : asset('assets/admin/img/200x200.png') %}
<div class="ui image">
{% if product.isConfigurable() and product.variants|length > 0 %}
{% include '@SyliusAdmin/Product/Show/_imageVariants.html.twig' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% elseif product.images.first %}
{% set path = product.images.first.path|imagine_filter(filter|default('sylius_admin_product_thumbnail')) %}
{% else %}
{% set path = '//placehold.it/50x50' %}
{% set path = asset('assets/admin/img/50x50.png') %}
{% endif %}

<img src="{{ path }}" alt="" class="ui bordered image sylius-grid-image" />
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
{% set path = source_path|imagine_filter(filter|default('sylius_shop_product_large_thumbnail')) %}
{% else %}
{% set original_path = '//placehold.it/400x300' %}
{% set original_path = asset('assets/shop/img/400x300.png') %}
{% set path = original_path %}
{% endif %}

Expand All @@ -22,7 +22,7 @@

<div class="ui small images">
{% for image in product.images %}
{% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_small_thumbnail') : '//placehold.it/200x200' %}
{% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_small_thumbnail') : asset('assets/shop/img/200x200.png') %}
<div class="ui image">
{% if product.isConfigurable() and product.enabledVariants|length > 0 %}
{% include '@SyliusShop/Product/Show/_imageVariants.html.twig' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% elseif product.images.first %}
{% set path = product.images.first.path|imagine_filter(filter|default('sylius_shop_product_thumbnail')) %}
{% else %}
{% set path = '//placehold.it/200x200' %}
{% set path = asset('assets/shop/img/200x200.png') %}
{% endif %}

<img src="{{ path }}" {{ sylius_test_html_attribute('main-image') }} alt="{{ product.name }}" class="ui bordered image" />
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1bdbddd

Please sign in to comment.