merefield
(Robert)
February 13, 2024, 8:10pm
1
I might be seeing things, but this component is expecting a model with a topic object contained:
However, when I log this model out, there is no longer a topic attribute?:
Is there a reason the topic attribute was removed? I was actually using it too for an extension to the adplugin
2 Likes
david
(David Taylor)
February 14, 2024, 11:45am
3
Hi Robert - I don’t think this was intentional. Were you able to find out what @model
is referring to? Would be good to work out whether it was a core or plugin change.
1 Like
merefield
(Robert)
February 14, 2024, 11:56am
4
Is it not taking the Post model passed down by the post-bottom
connector?
{{post-bottom-ad model=this}}
That said, I performed a search for post-bottom
on the discourse repo and it comes up blank … I’ll dig a bit more
1 Like
merefield
(Robert)
February 14, 2024, 12:44pm
5
This seems very old code:
transformed.cloaked = _cloaked[post.id];
postTransformCallbacks(transformed);
if (transformed.isSmallAction) {
result.push(
this.attach("post-small-action", transformed, { model: post })
);
} else {
transformed.showReadIndicator = attrs.showReadIndicator;
result.push(this.attach("post", transformed, { model: post }));
}
// Post gap - after
const afterGap = after[post.id];
if (afterGap) {
result.push(
this.attach(
"post-gap",
{ pos: "after", postId: post.id, gap: afterGap },
{ model: post }
Which contains the topic object, so things change below this
2 Likes
david
(David Taylor)
February 14, 2024, 1:43pm
6
Ok I see what happened here - thanks for the heads-up @merefield
discourse:main
← discourse:widget-model
opened 01:41PM - 14 Feb 24 UTC
Changes in 0948d6b19e34320f95226cc43fbce976b71ceb31 caused the post-bottom-ad co… mponent to start receiving the widget-ised 'transformedPost' instead of the original `post` model. In most cases this difference didn't matter, but it did cause noticable issues with `@model.category` and `@model.topic`.
This commit also deletes the unused `post-bottom/discourse-adplugin.hbs` connector. In the past, the adplugin itself was defining the post-bottom outlet. But now, we use RenderGlimmer to load the `post-bottom-ad` directly.
Two things:
During some refactoring a few months ago, we inadvertantly started passing the ‘transformedPost’ instead of ‘post’ into post-bottom-ad
During the same refactoring, we left an old post-bottom/discourse-adplugin.hbs
file lying around. It didn’t actually do anything, but it made this issue waaay more tricky to figure out
4 Likes
merefield
(Robert)
February 14, 2024, 2:22pm
7
David Taylor:
tricky to figure out
Is the perfect description
The post stream UI architecture is quite a beast!
Thanks very much for looking into this!!
6 Likes
david
(David Taylor)
Closed
February 19, 2024, 8:00am
8
This topic was automatically closed after 4 days. New replies are no longer allowed.