CMS Development

JHeatwole
Participante

related_blog_posts not working

resolver

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 Solução aceita
dennisedson
Solução
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

related_blog_posts not working

resolver

I did a terrible job watching this issue 😞

Looks like a fix was deployed at 10.17am est.

Exibir solução no post original

16 Respostas 16
RMarins
Participante

related_blog_posts not working

resolver

@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 Avaliação positiva
dennisedson
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

related_blog_posts not working

resolver

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

0 Avaliação positiva
JHeatwole
Participante

related_blog_posts not working

resolver

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

JHeatwole
Participante

related_blog_posts not working

resolver

@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 Avaliação positiva
RMarins
Participante

related_blog_posts not working

resolver

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

dennisedson
Solução
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

related_blog_posts not working

resolver

I did a terrible job watching this issue 😞

Looks like a fix was deployed at 10.17am est.

neobats
Participante

related_blog_posts not working

resolver

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

resolver

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
Participante

related_blog_posts not working

resolver

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 Avaliação positiva
dennisedson
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

related_blog_posts not working

resolver

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
Participante

related_blog_posts not working

resolver

Thanks so much!

0 Avaliação positiva
RMarins
Participante

related_blog_posts not working

resolver

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
Participante

related_blog_posts not working

resolver

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

JHeatwole
Participante

related_blog_posts not working

resolver

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
Participante

related_blog_posts not working

resolver

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 Avaliação positiva
JHeatwole
Participante

related_blog_posts not working

resolver

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