CMS Development

JHeatwole
Participant

related_blog_posts not working

SOLVE

Hi everyone,

 

I am using a related_blog_posts tag with a callback that was working fine before today, but now I'm getting an "IllegalArgumentException: Cannot convert property featuredImageResizeOptions to query parameter, OBJECT is not a valid type" error event though I didn't change anything and the related posts won't render. Is anyone else getting this error?

 

------

 

Example page: https://blog-mandrytechnology-com.sandbox.hs-sites.com/services/mandry-manage

Under the "Recent Managed IT Services Resources" heading

 

------

 

Module code:

 

{% related_blog_posts blog_ids="{{ module.blog_field }}", tags="{{ module.tag_field }}", limit='{{ module.number_to_show }}', callback="blog_post_formatter" %}

<script>
var blog_post_formatter = function(blogposts) {

var formatted = '<div class="row row-cols-1 row-cols-md-2 row-cols-lg-{{ module.number_of_columns }} g-4">';
for (var i = 0; i < blogposts.length; i++) {
var blogpost = blogposts[i];
formatted += '<div class="col">';
formatted += '<div class="card h-100">';
{% if module.show_image %}formatted += `<div class="card-img-top card-img-div" alt="${blogpost.featuredImageAltText}" style="background-image: url(${blogpost.featuredImage});
background-size: cover; height: 250px;"></div>`;{% endif %}
formatted += '<div class="card-body d-flex flex-column align-items-start">';
formatted += `<h5 class="card-title pb-3">${blogpost.name}</h5>`;
{% if module.show_description %}formatted += `${blogpost.postSummary}`;{% endif %}
formatted += `<a href="${blogpost.url}" class="btn btn-outline-primary mt-auto">{% inline_text field="button_label" value="{{ module.button_label }}" %}</a>`;
formatted += '</div>';
formatted += '</div>';
formatted += '</div>';
}
formatted += '</div>';
return formatted;
}
</script>

 

-----

 

Thanks!

1 Accepted solution
dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

related_blog_posts not working

SOLVE

I did a terrible job watching this issue 😞

Looks like a fix was deployed at 10.17am est.

View solution in original post

16 Replies 16
RMarins
Participant

related_blog_posts not working

SOLVE

@dennisedson @WendyGoh Could you just confirm if the related_blog_posts is actually working as expected ?
I am currently getting blog posts, but seems like the limit being set to 200 breaks the query. Setting it to up to 199 works as expected, from 200 the latest post I have isn't fetched.


199 - https://www.lancom.tech/_hcms/related-blog-posts-callback?targetBlogIds=36370869714&macro=default&li...

200 - https://www.lancom.tech/_hcms/related-blog-posts-callback?targetBlogIds=36370869714&macro=default&li...

 

 

 

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

related_blog_posts not working

SOLVE

I have not seen any reports that it isn't working as expected currently 🤔

0 Upvotes
JHeatwole
Participant

related_blog_posts not working

SOLVE

@dennisedson @RMarins @neobats Never mind! They are showing now. Thank you everyone!

JHeatwole
Participant

related_blog_posts not working

SOLVE

@RMarins @neobats 

 

Haha no worries @dennisedson. I did notice it was working where I just have it as a regular module added to pages (example: https://blog-mandrytechnology-com.sandbox.hs-sites.com/services/mandry-manage), but it still isn't working where it's part of my blog template (example: https://blog.mandrytechnology.com/resources/supporting-a-worthy-cause-foundation-for-hcm). Is anyone else having that issue?

0 Upvotes
RMarins
Participant

related_blog_posts not working

SOLVE

@dennisedson@JHeatwole @neobats Looks like it's all working again. Could you confirm that you are also seeing this ?

dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

related_blog_posts not working

SOLVE

I did a terrible job watching this issue 😞

Looks like a fix was deployed at 10.17am est.

neobats
Participant

related_blog_posts not working

SOLVE

Hey Dennis! We saw the fix. I just verified that at least for me (cc. @JHeatwole ) that it's working in my blog template in my sandbox.

WendyGoh
HubSpot Employee
HubSpot Employee

related_blog_posts not working

SOLVE

Hey @JHeatwole  @neobats,

 

Happy to help here 🙂 

 

Thanks for pointing this out! I was able to reproduce this error as well.

 

For this case, I've reached out to our internal team to check on it and I'll keep you both posted here.

neobats
Participant

related_blog_posts not working

SOLVE

Hey WendyGoh!

 

Thanks for this update! Do you have an ETA on when we could expect a fix or how we could roll back to a previous version?

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

related_blog_posts not working

SOLVE

Hey all!
Wendy is out for the day.  I will monitor this issue and report back when there is a fix.

Thanks for reporting !

JHeatwole
Participant

related_blog_posts not working

SOLVE

Thanks so much!

0 Upvotes
RMarins
Participant

related_blog_posts not working

SOLVE

Yep, I'm getting the exact same issue. Working fine before today and all of the sudden it stopped working. I can only assume this is an internal issue with the related_blog_posts method.
I have it on a module and a few templates (Pages,Blogs).

neobats
Participant

related_blog_posts not working

SOLVE

I'm getting this all of a sudden too. The markup hasn't changed from when it was working.

JHeatwole
Participant

related_blog_posts not working

SOLVE

Same. I talked to support and I think they thought I just messed the module up at first but because it's happening for you too, he said they are going to check on it internally.

neobats
Participant

related_blog_posts not working

SOLVE

I did some more poking around and in another template, I added the module as a dnd_module, and it worked fine.

Where I'm encountering the issue is in a blog page template, which does not support dnd_areas, so I can't try the same fix.

0 Upvotes
JHeatwole
Participant

related_blog_posts not working

SOLVE

Interesting. Yes I have it on a blog page template but also as a module that I just add to pages as needed and isn't part of the page template and it's not working in either place. It seems to be an issue with the related_blog_posts tag itself because the error shows up even if that tag is the only thing that exists in the code (screenshots below).

 

Full module code:image-Oct-20-2021-08-25-08-29-PM.png

related_blog_posts tag only:

image-Oct-20-2021-08-25-24-53-PM.png