Pim-community-dev: κ°•ν™” νŽ˜μ΄μ§€μ—μ„œ μ œν’ˆ PDF 내보내기 였λ₯˜

에 λ§Œλ“  2020λ…„ 06μ›” 16일  Β·  6μ½”λ©˜νŠΈ  Β·  좜처: akeneo/pim-community-dev

:bug: 버그 λ₯Ό λ³΄κ³ ν•©λ‹ˆλ‹€ . :bug:

Akeneo 버전: CE 4.0.31

μ œν’ˆ κ°•ν™” νŽ˜μ΄μ§€μ—μ„œ pdfλ₯Ό λ‹€μš΄λ‘œλ“œν•˜λ©΄ μ•„λž˜ URL둜 μ΄λ™ν•˜κ³  였λ₯˜κ°€ ν‘œμ‹œλ©λ‹ˆλ‹€. http://<pimhost>/enrich/product/1018/download-pdf?dataLocale=en_US&dataScope=ecommerce

Impossible to invoke a method ("__toString") on a string variable ("Some value")
in vendor/akeneo/pim-community-dev/src/Akeneo/Pim/Enrichment/Bundle/Resources/views/Product/renderPdf.html.twig (line 118)

pim_catalog_simpleselect 및 pim_catalog_multiselect μœ ν˜• content 이 쀄 114 μ—μ„œ 이미 λ¬Έμžμ—΄λ‘œ λ³€ν™˜λ˜μ—ˆκΈ° λ•Œλ¬Έμ— λ°œμƒν•©λ‹ˆλ‹€.
{% set content = optionLabels[attribute.code] %}

같은 νŽ˜μ΄μ§€μ˜ 또 λ‹€λ₯Έ κ΄€λ ¨ λ¬Έμ œλŠ” 110 행에 μžˆμŠ΅λ‹ˆλ‹€.
pim_catalog_image μœ ν˜•μ˜ 경우 content λŠ” data 속성이 μžˆμ§€λ§Œ media 속성이 μ•„λ‹Œ $ Akeneo\Pim\Enrichment\Component\Product\Value\MediaValue 의 μΈμŠ€ν„΄μŠ€μž…λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ κ·Έ 쀄은 content.media λ₯Ό μ‚¬μš©ν•˜μ—¬ 였λ₯˜λ₯Ό λ°œμƒμ‹œν‚΅λ‹ˆλ‹€.

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

미리 λ‹΅λ³€λ“œλ¦¬μ§€ λͺ»ν•΄ μ£„μ†‘ν•©λ‹ˆλ‹€.

λ‚˜λŠ” 그것을 μ‘°μ‚¬ν•˜κ³  그것에 λŒ€ν•œ PR을 μ—΄μ—ˆμŠ΅λ‹ˆλ‹€ : https://github.com/akeneo/pim-community-dev/pull/12496
4.0.xμ—μ„œ 곧 λ³‘ν•©λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€.

λͺ¨λ“  6 λŒ“κΈ€

λ‹€μŒ diffλŠ” ν˜„μž¬ 문제λ₯Ό ν•΄κ²°ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

diff --git a/src/Akeneo/Pim/Enrichment/Bundle/Resources/views/Product/renderPdf.html.twig b/src/Akeneo/Pim/Enrichment/Bundle/Resources/views/Product/renderPdf.html.twig
index 3730bea3c2b..7576ad0ef82 100644
--- a/src/Akeneo/Pim/Enrichment/Bundle/Resources/views/Product/renderPdf.html.twig
+++ b/src/Akeneo/Pim/Enrichment/Bundle/Resources/views/Product/renderPdf.html.twig
@@ -107,11 +107,12 @@
                                 {% set content = product.getValue(attribute.code, locale_attribute, channel_attribute) %}
                                 {% set manualHeight = true %}

-                                {% if 'pim_catalog_image' == attribute.type and content.media is not null %}
-                                    {% set content = content.media.originalFilename %}
+                                {% if 'pim_catalog_image' == attribute.type and content.data is not null %}
+                                    {% set content = content.data.originalFilename %}
                                     {% set manualHeight = false %}
                                 {% elseif ('pim_catalog_simpleselect' == attribute.type or 'pim_catalog_multiselect' == attribute.type) and attribute.code in optionLabels|keys %}
                                     {% set content = optionLabels[attribute.code] %}
+                                    {% set manualHeight = false %}
                                 {% endif %}

                                 {% if content != null and manualHeight == true %}

μ•ˆλ…•ν•˜μ„Έμš” @adhocore μž…λ‹ˆλ‹€ .
μ΄λ ‡κ²Œ μ •ν™•ν•œ μ„€λͺ…κ³Ό ν•¨κ»˜ 이 문제λ₯Ό μ—΄μ–΄μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€.

__toString 의 첫 번째 λ¬Έμ œμ™€ κ΄€λ ¨ν•˜μ—¬ λΉ λ₯Έ μˆ˜μ •μ΄ 4.0.x에 곧 λ³‘ν•©λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€. https://github.com/akeneo/pim-community-dev/pull/12430

두 번째 λ¬Έμ œλŠ” μ‹œκ°„μ„ λ‚΄μ„œ μ΅œλŒ€ν•œ 빨리 μ‚΄νŽ΄λ³΄λ„λ‘ ν•˜κ² μŠ΅λ‹ˆλ‹€.

μ•ˆλ…•ν•˜μ„Έμš”,

두 번째 λ¬Έμ œμ— λŒ€ν•œ μ†Œμ‹μ΄ μžˆμŠ΅λ‹ˆκΉŒ?

정말 κ°μ‚¬ν•©λ‹ˆλ‹€πŸ™

μˆ˜μ •μ€ λ‹€μŒκ³Ό 같이 media 속성에 μ •μ˜λœ twig ν•¨μˆ˜λ₯Ό μ‚¬μš©ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€.

{% if 'pim_catalog_image' == attribute.type and content.media is defined and content.media is not null %}

미리 λ‹΅λ³€λ“œλ¦¬μ§€ λͺ»ν•΄ μ£„μ†‘ν•©λ‹ˆλ‹€.

λ‚˜λŠ” 그것을 μ‘°μ‚¬ν•˜κ³  그것에 λŒ€ν•œ PR을 μ—΄μ—ˆμŠ΅λ‹ˆλ‹€ : https://github.com/akeneo/pim-community-dev/pull/12496
4.0.xμ—μ„œ 곧 λ³‘ν•©λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€.

정말 κ°μ‚¬ν•©λ‹ˆλ‹€ πŸ‘ πŸ’ͺ

μˆ˜μ • 사항이 ν¬ν•¨λœ keneo의 μƒˆ 버전 λ¦΄λ¦¬μŠ€κ°€ μžˆλŠ” 경우 plsλŠ” 이 문제λ₯Ό 닫아도 λ©λ‹ˆλ‹€. κ°μ‚¬ν•©λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰