Skip Navigation

[Closed] Single Field overwrites custom field with same text

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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 20 replies, has 2 voices.

Last updated by Nigel 7 months, 3 weeks ago.

Assisted by: Nigel.

Author
Posts
#2639607
custom field overwritten.png

I am trying to:
When I use Single Field in a View it works when I first install the Single Field block.
When I afterwards edit the view the custom field from the chosen posts are overwritten by the first post (See image)
I actually think that it's a bug in the Single Field or in the View.
What do you think?
Best regards
Kristen

#2639715

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2023-08-31 at 12.18.21.png
Screenshot 2023-08-31 at 12.19.37.png

Hi Kristen

I checked your site and I see that the Single Field block is outputting the value of a custom field (screenshot), and when I edit the two pages that are being output by the View both pages have the same text value for the custom field (screenshot), and hence it is to be expected that the View outputs the same text for both.

#2639739

Hi Nigel.
Thank you for your reply.
It is correct that both pages right now has the same text - but if I try and change one of them it overwrites the text on the other page. This is only happening with the pages connected in a view using "Single Field".
Best regards.
Kristen

#2639745

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Can I try that myself with some test text?

#2639747

Yes. You can try it one these 2 pages.
hidden link
hidden link

As you can see I just again tried to write "test Kristen on pageID4686" and it also copied itself to pageID4691

#2639771

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I wondered if it were the view for related posts which includes the other page with the same field in its output that might be causing the issue, but I just tried setting something similar up on a local test site and I didn't experience that problem.

This is a development server, yes? So can we try updating the pages in a minimal environment, i.e. with all non-Toolset plugins disabled and using a default theme like twentytwentyone...

#2639787

Hello Nigel.
This is a developmentserver - but we are in the finishing so I would be sad if it all crashed and we should start over.
If you like I can take a Duplicator copy?

#2639805

Here is a link for duplicator files: hidden link

#2639823

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Thanks, I'll install that and get back to you.

#2640151

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2023-09-01 at 14.27.25.png

I think the problem arises because you have the same View inserted on both pages, which wouldn't ordinarily be a problem, but in your case you are using that View to display the same page that contains the View itself.

I suggest you delete the View from one of the pages and insert a new similar but distinct View in its place.

One of the Views will have a Query Filter to reference the other page, and then the second (different) View will similarly have a Query Filter to point to the other page.

Having two distinct Views should disentangle the page fields.

#2640301
Printscreen 2023-09-02 092905.png

Hi Nigel.
Thank you for your reply.
On page hidden link
I have now inserted a copy of the View (Other related pages-copy-1693638874) and changed sorting ID to 4691 on NIOSH Lifting Equation.(ID4686)

On the page hidden link
I have changed the text in the box "Excerpt box on archive page" on the page ID4691 to "test Kristen on pageID4691".

On the page hidden link
When I update the page ID4691 and afterwards go to hidden link the text on both page 4686 and 4691 has changed (See attached image)

What am I doing wrong?
Best regards
Kristen

#2640631

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hmmm. This is so strange. I've been updating the Views and the custom field content on these 3 pages and despite their being 3 distinct Views on those pages, the custom field values are getting overwritten.

I am going to have to return to this, at the moment I can't account for why it's happening.

I'll get back to you.

#2641221

Hi Nigel.
Sorry I didn't answer you back and I'm glad you are looking in to it.
Do you have an estimate of time?
I wish you a pleasant day.
Kristen

#2641421

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Sorry for the delay getting back to you, we've had a high volume of tickets.

I'm a bit stuck on this. I'm taking an updated copy of your site to account for the changes you made with the Views, and I'll take another crack at it, and if I can't spot how this is happening I'll call in one of the developers to investigate.

I'll give you an update in the morning.

#2641675

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

OK, I traced the problem to the second View on the pages (that displays flags).

You have the same View on both page with ID 4686 and page ID 4691.

If you delete the View from one of the pages and insert a new View which does the same thing, but which is not the same View, then the entanglement problem should disappear.

I think we've discussed before about the structure of your site being very unusual—essentially everything is a page, differentiated by taxonomy, rather than using different custom post types—which I understand is because this is based on an imported Drupal site if I remember correctly.

It is this reason why you are experiencing some odd issues that haven't come up with other users.

The above worked on my local copy of your site, if you could please verify the same on your own site.

The topic ‘[Closed] Single Field overwrites custom field with same text’ is closed to new replies.