Error in saved sections from child theme

In a child theme, when you save a section there is an error becaue the path of the modules in the section are linked from the parent theme and not the child theme.

Hi @SaltyKaren, I hope that you are well!
Thank you for asking the HubSpot Community and for sharing the screenshot, that’s really helpful!
I understand that you are getting the following error message on your page:
“There was an error inserting your section.
One of the modules in this section has been deleted or isn’t allowed to be added to this page.
This might affect the look and layout of your section.
Would you like to continue inserting?”
1. Could you please share the code you are using or the link to the page you are referring to (without confidential information)?
2. Which theme are you using?
I’d love to put you in touch with our Top Experts regarding modules: Hi @albertsg, @SteveHTM, @Anton and @evaldas do you have suggestions to help @SaltyKaren, please?
Have a lovely weekend and thanks so much in advance for your valuable contributions!
Bérangère

I can’t provide a link cuz it’s not published yet. But the reason I knew why the modules inheritted from the parent theme still uses the parent theme’s path is because I tried copying the section code. When I checked I saw one of the path belongs to the parent theme. I’ve attached a screenshot of the code I got.

Hey @SaltyKaren,

thanks for providing the code.

A potential error can be the non-relative path of the module(s).

...
path="/ncad-s2/modules/multiple-buttons"
...

If you’re using different themes/folders, my recommendation would be to copy the path of the module if you’re using different themes (parent/child).

Simply right-click on the desired module, select “copy path” and paste it into the section.

Also, make sure that the theme.json of the child-theme has

"extends": "PATH-TO-PARENT-THEME",

in it. Otherwise, HubSpot won’t recognize the theme as a child theme which can also lead to errors.

best,

Anton

The problem is with Saved sections. The one where we don’t have code access (See screenshot).

The Section code I provided above was coming from when I enter developer mode and copied the HubL code for the section. It showed the inheritted modules still uses parent’s path even though it’s being added on a page that uses a child theme.

Hi @SaltyKaren and thanks for the additional information!
Hi @Anton, @sylvain_tirreau and @zach_threadint do you have any tips to share with @SaltyKaren, please?
Have a great day and thank you very much!
Bérangère

Hi @SaltyKaren,

Can you confirm if all modules in the section are part of the theme?