Skip Navigation

[Resolved] Errors on viewing content templates

This support ticket is created 3 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 16 replies, has 2 voices.

Last updated by Kelly 3 years ago.

Assisted by: Waqar.

Author
Posts
#1990329
assoc_error.png

Hi,

I'm migrating my toolset site from one domain to another. I've used export/import functionality to move all the toolset content and then the wordpress importer to move posts and custom posts types to the new site. This is going ok. HOwever, Iv'e two open issues:

1) It's asking me to import relationships, but they all have the old domain name in the relationship name. Can I bulk change these to the new domain name easily? (See attachment)

2) My views/content templates aren't working properly.

If I go to the page for one of the custom posts, I don't get the template. If I tried an edit from the content templates screen, I get a white screen with a bunch of react errors:

eg:
SyntaxError: Unexpected token u in JSON at position 1
at JSON.parse (<anonymous>)
at save (blocks.editor.js?ver=2.6.6:1)
at Wt (blocks.min.js?ver=9ed25ffa009c799f99a4340915b6dc6a:3)
at Qt (blocks.min.js?ver=9ed25ffa009c799f99a4340915b6dc6a:3)
at block-editor.min.js?ver=7bc2f41a2f2e0da426f12f29b2139cae:12
at hooks.min.js?ver=50e23bed88bcb9e6e14023e9961698c1:2
at $r (blocks.min.js?ver=9ed25ffa009c799f99a4340915b6dc6a:3)
at Ur (blocks.min.js?ver=9ed25ffa009c799f99a4340915b6dc6a:3)
at Array.map (<anonymous>)
at Ur (blocks.min.js?ver=9ed25ffa009c799f99a4340915b6dc6a:3)

react-dom.min.js?ver=16.13.1

I've disabled most of the plugins in use and tried it using twenty twenty one theme

#1990389

Hmm. I went into one of my custom posts, and assigned them to a content template which wasn't associated and now the content templates editor is working. Was it missing this link causing it to crash?

#1991713

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

Based on what you've shared, it seems that you've moved the website from one location/domain to another manually, but not all the URLs saved in the database, have been updated according to the new location/domain.

Did you perform a search and replace operation on the database, to update all saved URLs?
( ref: https://wordpress.org/support/article/moving-wordpress/#changing-your-domain-name-and-urls )

The manual migration process is a complicated task that can leave room for issues like this. The automated migration plugins can simplify the entire process for you and these are the two which we use and recommend:

https://wordpress.org/plugins/duplicator/
https://wordpress.org/plugins/all-in-one-wp-migration/

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1992019

HI,

I've search and replace to change all the old urls to the new ones in the database but the association import still can't see the pages. I've taken the url given in the error and that loads fine.

Is there somewhere else I need to search and replace?

#1993407

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back.

Can you please share a clone/snapshot of the website, so that it can be investigated on a different server?
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )

Note: I've set your next reply as private.

#1996049

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the zip file.

When I tried to deploy the clone, it showed me notice about the incorrect size of the archive.
"The expected archive size should be around [406.72MB]. The actual size is currently [156.62MB]."

Can you please check if the shared installer and the archive files are from the same duplicator package?

Note: If you still have access to the website on the old domain, you can also migrate it as a whole to the new domain using the same duplicator plugin.

I've set your next reply as private again.

#1999119

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the complete archive from the duplicator package.

During troubleshooting, I noticed that the relationships which are showing error on the relationship import screen are the ones that have the plain or non-pretty permalink GUID stored in the related custom field:

For example, the pretty permalink for the "Autumn Plan 2020" mesocycle post with ID: 6401 is:
{yourwebsite.com}/mesocycle/winter-plan/

But in the missing relationship items, it's non-pretty URL is saved:
{yourwebsite.com}/?post_type=mesocycle&p=6401

As a test and example, I searched and replaced 13 instances of this URL in the database, which fixed the 13 relationships on the relationship import screen too.

You can repeat the same for each missing relationship entry you can find until all of them are using the correct URLs and are ready to be imported.

#1999385

oh great! The postmeta for that post is _toolset_associations_macrocycle-mesocycle = hidden link

Is this because I imported them without pretty permalinks? This metakey doesn't exist in the original database so I'm a bit confused of how you are supposed to fix this?

#1999401

Also, why is the importer failing to find permalinks which DO exist? I.e. the import is popping up things like:

"Can't find a parent post with GUID: hidden link" for child 6111. The page it's looking for actually exists and has "hidden link" in the _toolset_associations_form-videos meta key.

I've removed the s from https as I don't yet has an SSL cert on this site, but it still doesn't find it?

#1999847

OK, I ended up redoing the import, in I believe exactly the same way as before, and it just worked and found all the relationships this time. I don't know what I did differently :/

#2000897

I've just realised I still have an issue. I'm able to look at all my content templates apart from one, the session template. Can you check on the duplicated site you took and see if you can work it out? I'm still getting the javascript errors in the console above.

#2000899

If I try and create a replacement template, I get this error if I flip it to code view:

TypeError: Cannot read property 'ownerDocument' of undefined
at hidden link
at Bh (hidden link)
at Dj (hidden link)
at unstable_runWithPriority (hidden link)
at Da (hidden link)
at xb (hidden link)
at Te (hidden link)
at hidden link
at unstable_runWithPriority (hidden link)
at Da (hidden link)

#2002081

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing these details.

I checked the content template named "Template for Sessions" and noticed that it was not editable with a number of errors in the browser's console.

I'm not sure how your migration process affected this, but, some characters in the code of the form block were changed.

Can you please go to your database and in the "post_content" column in the "wp_posts" table, replace all instances of "u0022" with "\u0022" for the post with ID "7224".
( which is the ID for the content template: "Template for Sessions")

There will be a total of 20 instances and for me, this fixed the content template on the clone of your website.

#2003161

Hi,

I think this is a Toolset bug. Changing out the broken u0022 worked for opening the template. However, if I then duplicate that template using the duplicate link, the duplicate has the same problem with the react errors. Something is saving the data incorrectly?

#2003685

fyi, I'm seeing similar problems in other areas. I created a login template as per https://toolset.com/course-lesson/creating-custom-login-forms/

Going back into that template causes this error:

TypeError: r is not a function
at hidden link
at Bh (hidden link)
at Dj (hidden link)
at unstable_runWithPriority (hidden link)
at Da (hidden link)
at xb (hidden link)
at mk.Events.current (hidden link)
at Ei (hidden link)

This is what's in the tempate if I used the button it gives me to see it:
<!-- wp:toolset-blocks/fields-and-text -->
<div class="tb-fields-and-text" data-toolset-blocks-fields-and-text="1"><p>[wpv-login-form redirect_url="hidden link" allow_remember="true"]</p></div>
<!-- /wp:toolset-blocks/fields-and-text -->

If I delete and recreate the template, the same thing happens.

The login form sort of works, as in I'm logged in, BUT it appears to be redirecting me to http, instead of https. I can't work out why.

New threads created by Waqar and linked to this one are listed below:

https://toolset.com/forums/topic/split-errors-on-viewing-content-templates-login-template/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.