Drupal 8.5.x-dev & commerce-8.x-2.x-dev
has inconsistent <div>parent
without id or class.
Twig doesn't output any suggestions before this <div>.
In source html i don't see cart block <section at all –
apparently it is added by JavaScript on page load, right?
I've changed theme, the block`s region,
turned of dc_ajax_add_cart module, cleared the cache – all stays the same.
Comments
Comment #2
Leagnus commentedComment #3
Leagnus commentedComment #4
Leagnus commentedComment #5
megachrizCan you post the full HTML code of the cart block? That would make it easier to see what exactly is wrong.
What do you mean with "inconsistent
<div>parent"? Just a div tag without attributes? Or a div that isn't properly closed?Comment #6
Leagnus commentedMegaChriz, a div tag without attributes
Comment #7
mglamanAnything beyond
<div class="cart--cart-block">is from your theme or the contextual module.Comment #8
megachrizThe HTML code of the cart block (+ wrapper HTML) in the theme 'Bartik' with a fresh install of Commerce looks like this:
So the div tag without attributes is likely to come from your theme. I've seen div tags without attributes as well while developing my own theme. This seems to be related to Drupal outputting less CSS classes by default (compared to D7). Templates with (a lot of) default CSS classes have been moved to the theme 'classy'.
Comment #9
Leagnus commentedit's not Drupal commerce` issue: i've putted a views block into content region
and have set bartik as default –
result stayed the same: no twig tips before the div
no id or class in this div.
Somebody, please move this theme to Drupal 8.5 dev common branch of issues.
region.html.twig outputs this divs inside its {{ content }}
Comment #10
Leagnus commentedComment #11
Leagnus commentedComment #12
Leagnus commentedComment #13
Anonymous (not verified) commented@Leagnus, you absolutely right, it's a very controversial wrapper. See #736066-270: ajax.js insert command sometimes wraps content in a div, potentially producing invalid HTML and other bugs, #270 patch should help.
Comment #14
Leagnus commentedvaplas, thank you, #270 removes the div.
Comment #15
effulgentsia commentedThanks for the issue report and for tracking down the root issue in #13. Looks like this is a duplicate of that one, so closing it as such. Please reopen this issue if there's something not covered by that one. Thanks.