AdPlugin not compatible with changes to model?

AI-generated summary

The AdPlugin is experiencing compatibility issues due to changes in the model. merefield noticed that the topic attribute is missing from the model, which was previously expected by the plugin. After investigation, david found that the issue occurred due to a refactoring mistake a few months ago, where the transformedPost was passed instead of the post into post-bottom-ad. Additionally, an old template file was left behind, making the issue harder to resolve. The issue is now understood and acknowledged, and merefield thanked david for looking into the problem.

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 :frowning:

2 Likes

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

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

This seems very old code:

Which contains the topic object, so things change below this :sweat_smile:

2 Likes

Ok I see what happened here - thanks for the heads-up @merefield

Two things:

  1. During some refactoring a few months ago, we inadvertantly started passing the ‘transformedPost’ instead of ‘post’ into post-bottom-ad

  2. 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 :sweat_smile:

4 Likes

Is the perfect description :slight_smile:

The post stream UI architecture is quite a beast!

Thanks very much for looking into this!!

6 Likes

This topic was automatically closed after 4 days. New replies are no longer allowed.