- Issue created by @lrwebks
- π©πͺGermany Anybody Porta Westfalica
We should call these "ad placements" or something like this perhaps, so that the site owner can decide how to use it with more flexibility.
Ad placements can this way be either created just by size, e.g. "Rectangle" or can even be more precise for a region, like "Content area rectangle".
They should therefore have a human-readable label and a machine name. The ad placement can be selected in the ad block (eventually multi-value) and in the ad to publish there (eventually multi-value).
- π©πͺGermany Anybody Porta Westfalica
Guess this makes sense as next step, but we should first ensure we have a valid concept.
- π©πͺGermany lrwebks Porta Westfalica
@anybody and I have now established the concept that we want to implement, and I will do that here.
- Assigned to lrwebks
- Status changed to Needs work
19 days ago 12:52pm 17 June 2025 - π©πͺGermany lrwebks Porta Westfalica
One lingering issue that I still encounter here is that, for some reason, the parameters sent over from the JS to the Controller on the page do not contain the βplacementβ value; even though they definitely should after some thorough checking on my side. BUT this only happens when you are admin for another reason? This baffles me quite a bit.
@anybody or @grevil, would you mind taking a look at that?
Apart from that bug, all features are implemented here. - π©πͺGermany Anybody Porta Westfalica
@lrwebks commented!
Before merging this, I need to test it myself as soon as I have the time.
- First commit to issue fork.
- π©πͺGermany Grevil
@lrwebks you forgot to modify the database scheme in the update hook, leading to the following error:
Drupal\Core\Entity\Query\QueryException: 'placement' not found in Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable() (line 373 of core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).
- π©πͺGermany Grevil
Ok, fixed the update hook and tested, works as expected now! Continuing my review.
- π©πͺGermany Grevil
Note, that this clears the revision data for "placement" (previously named size), but I really don't want to waste any more time on this π
FYI, nice for our Snippet collection:
https://www.drupal.org/docs/drupal-apis/update-api/updating-entities-and... β
https://www.drupal.org/node/2554097 β - π©πͺGermany Grevil
Ok, I forgot that by default the revisions are being used for the entity to be displayed, so we actually need to include that in the update hook as well.
- π©πͺGermany Grevil
Ok, this should do the trick. I will test it tommorow.
- π©πͺGermany Grevil
Yea, works great. Now to the final issue, pointed out in #7
- π©πͺGermany Grevil
I can not reproduce #7. When logged in as admin, I can see the ad and "placement" is part of the response data:
- π©πͺGermany Anybody Porta Westfalica
@grevil makes sense to me, I couldn't really see a reason for this unexpected behavioru. I'd be fine to assume it's a special bug in @lrwebks's environment... Not worth deeper checks for now?
- π©πͺGermany Grevil
Alright, everything else works great and as expected! Please review new adjustments @anybody.
- π©πͺGermany Grevil
@anybody yea probably a browser cache issue, since "placement" did not exist before.
-
anybody β
committed b7c69fa5 on 11.x authored by
lrwebks β
Issue #3519431 by lrwebks, grevil, anybody: Turn ad sizes into ad...
-
anybody β
committed b7c69fa5 on 11.x authored by
lrwebks β