Problem/Motivation

Image and pagination are broken cause of Attribute property.

Steps to reproduce

  • Run storybook
  • Check image field

Proposed resolution

  • Change "control": "object", to "control": "Drupal\\Core\\Template\\Attribute", only for attributes in all .stories.json files

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Update Release Notes and Update Helper on new feature change/addition
  • ✅ Release varbase-10.0.0, varbase_components-2.0.3

Varbase update type

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

Comments

Ahmad Khader created an issue. See original summary.

ahmad khader’s picture

ahmad khader’s picture

Status: Active » Needs review
rajab natshah’s picture

Title: Fix Attributes object not working in storybook » Fix not working Attributes object in storybook
Issue summary: View changes

Are you facing this after the update to Drupal ~10.3.0 ?

ahmad khader’s picture

No, issue appeared before and after the update to Drupal ~10.3.0

broken attribute locally

After the fix

After fix

There was an error while making the request to Drupal. Locate the request in the Network tab of your browser's developer tools for more information.
Requested URL: http://varbase.lndo.site/_cl_server?_storyFileName=.%2Fdocroot%2Fmodules%2Fcontrib%2Fvarbase_components%2Fcomponents%2Fatoms%2Fimage%2Fimage.stories.json&_drupalTheme=vartheme_bs5
Response code: 500 (Internal Server Error)
Response Headers:
cache-control: must-revalidate, no-cache, private
content-language: en
content-type: text/html; charset=UTF-8
expires: Sun, 19 Nov 1978 05:00:00 GMT

Response body: The website encountered an unexpected error. Try again later.<br><br><em class="placeholder">Twig\Error\RuntimeError</em>: An exception has been thrown during the rendering of a template (&quot;Data provided to prop &quot;attributes&quot; for component &quot;vartheme_bs5:image&quot; is not a valid instance of &quot;Drupal\Core\Template\Attribute&quot;&quot;). in <em class="placeholder">Twig\Template-&gt;yield()</em> (line <em class="placeholder">1</em> of <em class="placeholder">module/contrib/varbase_components/components/atoms/image/image.twig</em>). <pre class="backtrace">Drupal\sdc\Component\ComponentValidator-&gt;validateProps(Array, Object) (Line: 130)
Drupal\sdc\Twig\TwigExtension-&gt;doValidateProps(Array, &#039;vartheme_bs5:image&#039;) (Line: 112)
Drupal\sdc\Twig\TwigExtension-&gt;validateProps(Array, &#039;vartheme_bs5:image&#039;) (Line: 46)
__TwigTemplate_8001054e86c5d85ce64578670fd11d20-&gt;doDisplay(Array, Array) (Line: 360)
Twig\Template-&gt;yield(Array, Array) (Line: 135)
__TwigTemplate_e19aba110108afdb7d2a6a68af1e8a4f___224934562-&gt;doDisplay(Array, Array) (Line: 360)
Twig\Template-&gt;yield(Array) (Line: 43)
__TwigTemplate_e19aba110108afdb7d2a6a68af1e8a4f-&gt;doDisplay(Array, Array) (Line: 360)
Twig\Template-&gt;yield(Array) (Line: 335)
Twig\Template-&gt;render(Array) (Line: 38)
Twig\TemplateWrapper-&gt;render(Array) (Line: 234)
Drupal\Core\Template\TwigEnvironment-&gt;renderInline(&#039;{# inline_template_start #}{# This template was dynamically generated by sdc #}
{% embed &#039;varbase_components:image&#039; %}
{% endembed %}
&#039;, Array) (Line: 53)
Drupal\Core\Render\Element\InlineTemplate::preRenderInlineTemplate(Array)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Render\Renderer-&gt;doTrustedCallback(Array, Array, &#039;Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725&#039;, &#039;exception&#039;, &#039;Drupal\Core\Render\Element\RenderCallbackInterface&#039;) (Line: 859)
Drupal\Core\Render\Renderer-&gt;doCallback(&#039;#pre_render&#039;, Array, Array) (Line: 421)
Drupal\Core\Render\Renderer-&gt;doRender(Array) (Line: 493)
Drupal\Core\Render\Renderer-&gt;doRender(Array) (Line: 493)
Drupal\Core\Render\Renderer-&gt;doRender(Array, ) (Line: 240)
Drupal\Core\Render\Renderer-&gt;render(Array, ) (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer-&gt;Drupal\Core\Render\MainContent\{closure}() (Line: 627)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 231)
Drupal\Core\Render\MainContent\HtmlRenderer-&gt;prepare(Array, Object, Object) (Line: 128)
Drupal\Core\Render\MainContent\HtmlRenderer-&gt;renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber-&gt;onViewRenderArray(Object, &#039;kernel.view&#039;, Object)
call_user_func(Array, Object, &#039;kernel.view&#039;, Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher-&gt;dispatch(Object, &#039;kernel.view&#039;) (Line: 186)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength-&gt;handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength-&gt;handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 53)
Asm89\Stack\Cors-&gt;handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState-&gt;handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19).

rajab natshah’s picture

Issue summary: View changes

Change "control": "object", to "control": "Drupal\\Core\\Template\\Attribute", only for attributes in all .stories.json files

rajab natshah’s picture

Issue summary: View changes
Issue tags: +varbase-10.0.0, +varbase_components-2.0.3
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Issue summary: View changes

✅ Released varbase-10.0.0

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.