CMS Development

JHeatwole
Teilnehmer/-in

related_blog_posts not working

lösung

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 Akzeptierte Lösung
dennisedson
Lösung
HubSpot-Produktteam
HubSpot-Produktteam

related_blog_posts not working

lösung

I did a terrible job watching this issue 😞

Looks like a fix was deployed at 10.17am est.

Lösung in ursprünglichem Beitrag anzeigen

16 Antworten
RMarins
Teilnehmer/-in

related_blog_posts not working

lösung

@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-Produktteam
HubSpot-Produktteam

related_blog_posts not working

lösung

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

0 Upvotes
JHeatwole
Teilnehmer/-in

related_blog_posts not working

lösung

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

JHeatwole
Teilnehmer/-in

related_blog_posts not working

lösung

@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
Teilnehmer/-in

related_blog_posts not working

lösung

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

dennisedson
Lösung
HubSpot-Produktteam
HubSpot-Produktteam

related_blog_posts not working

lösung

I did a terrible job watching this issue 😞

Looks like a fix was deployed at 10.17am est.

neobats
Teilnehmer/-in

related_blog_posts not working

lösung

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

lösung

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
Teilnehmer/-in

related_blog_posts not working

lösung

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-Produktteam
HubSpot-Produktteam

related_blog_posts not working

lösung

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
Teilnehmer/-in

related_blog_posts not working

lösung

Thanks so much!

0 Upvotes
RMarins
Teilnehmer/-in

related_blog_posts not working

lösung

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
Teilnehmer/-in

related_blog_posts not working

lösung

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

JHeatwole
Teilnehmer/-in

related_blog_posts not working

lösung

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
Teilnehmer/-in

related_blog_posts not working

lösung

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
Teilnehmer/-in

related_blog_posts not working

lösung

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