Skip Navigation

[Resolved] [Potential bug report] post relationships

This support ticket is created 6 years, 3 months 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
- 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 13 replies, has 2 voices.

Last updated by Nigel 6 years, 2 months ago.

Assisted by: Nigel.

Author
Posts
#605416
Screenshot-2018-1-11 with workaround in place.png
Screenshot-2018-1-11 with problem showing.png

I am trying to:
Display featured image of the current post

Link to a page where the issue can be seen:
Well it can't be seen because I've added a workaround, but this is where the problem existed.
hidden link

I expected to see:
Featured image of current post

Instead, I got:
Featured image of parent post.

The code I'm using for the content template is below.

On line 20 I use:

<img src="[wpv-post-featured-image size="full" output="url" id="$exhibitor"]" />

to display the featured image of the parent post (exhibitor post type).

On line 42 I should be able display the featured image of the current post using:

[wpv-post-featured-image size="full"]

However, this actually displays the featured image of the parent post (exhibitor post type) for some reason.
See Screenshot-2018-1-11 with problem showing.png
Seems like the parent post type is staying in memory for the featured image shortcode.

I'm working around the problem using this instead.

[wpv-post-featured-image size="full" item="[wpv-post-id]"]

This displays the correct image for the current post.
See Screenshot-2018-1-11 with workaround in place.png

Best regards
Tim

<div class="et_pb_section et_section_specialty section_seminar nopadding">
	<div class="et_pb_row et_pb_row_3-4_1-4 widerow">
		<div class="et_pb_column et_pb_column_3_4 et_pb_specialty_column et_pb_css_mix_blend_mode_passthrough">
			<div class="et_pb_row_inner nopadding">
				<div class="et_pb_column et_pb_column_2_3 et_pb_column_inner">
					<div class="et_pb_text et_pb_module et_pb_bg_layout_light et_pb_text_align_left">
						<div class="et_pb_text_inner">
							<h1>[wpv-post-title]</h1>
							<p>Seminar Host: [wpv-post-title id="$exhibitor"]</p>[wpv-post-id id="$exhibitor"]
                          
							<p>Time: [convert_date timestamp="[wpv-post-field name='we_startdate']" format="time"]</p>
						</div>
					</div>
					<!-- .et_pb_text -->
				</div>
				<!-- .et_pb_column -->
				<div class="et_pb_column et_pb_column_1_3 et_pb_column_inner et-last-child">
					<div class="et_pb_module et_pb_image et_always_center_on_mobile">
					  <span class="et_pb_image_wrap">
<a href="#popup-[wpv-post-id id="$exhibitor"]" class="ari-fancybox et_smooth_scroll_disabled"><img src="[wpv-post-featured-image size="full" output="url" id="$exhibitor"]" /></a>
<div id="popup-[wpv-post-id id="$exhibitor"]" class="fancypopup fancybox-hide" group="exhibitors">
  [wpv-post-body view_template="exhibitor-popup-content" id="$exhibitor"]
</div>

                        
                      </span>
					</div>
				</div>
				<!-- .et_pb_column -->
			</div>
			<!-- .et_pb_row_inner -->
			<div class=" et_pb_row_inner">
				<div class="et_pb_column et_pb_column_4_4 et_pb_column_inner et-last-child seminar_border_column">
					<div class="et_pb_text et_pb_module et_pb_bg_layout_light et_pb_text_align_left">
						<div class="et_pb_text_inner">
							[wpv-post-body view_template="None"]
						</div>
					</div>
					<!-- .et_pb_text -->
					<div class="et_pb_module et_pb_image et_always_center_on_mobile">
						<span class="et_pb_image_wrap">
              [wpv-post-featured-image size="full" item="[wpv-post-id]"]
            </span>
					
					</div>
				</div>
				<!-- .et_pb_column -->
			</div>
			<!-- .et_pb_row_inner -->
			<div class="et_pb_row_inner">
				<div class="et_pb_column et_pb_column_1_2 et_pb_column_inner">
					<div class="et_pb_text et_pb_module et_pb_bg_layout_light et_pb_text_align_left">
						<div class="et_pb_text_inner">
							<p>Share this Seminar</p>
						</div>
					</div>
					<!-- .et_pb_text -->
				</div>
				<!-- .et_pb_column -->
				<div class="et_pb_column et_pb_column_1_2 et_pb_column_inner">
					<div class="et_pb_button_module_wrapper et_pb_module inline">
						<a class="et_pb_button et_pb_module et_pb_bg_layout_light green" href="<em><u>hidden link</u></em>">Back to Seminars</a>
					</div>
                  
					<div class="et_pb_button_module_wrapper et_pb_module inline">
						<a class="et_pb_button et_pb_module et_pb_bg_layout_light blue" href="<em><u>hidden link</u></em>">Book Now</a>
					</div>
				</div>
			</div>
			<!-- .et_pb_row_inner -->
          
			<div class="et_pb_row_inner">
				<div class="et_pb_column et_pb_column_4_4 et_pb_column_inner et-last-child seminar_border_column">
					<div class="et_pb_text et_pb_module et_pb_bg_layout_light et_pb_text_align_left">
                      <h2>Speaker Information</h2>
                      [wpv-view name="speaker-information" speakers="[wpv-post-field name='we_speakers']"]
					</div>
				</div>
			</div>
			<!-- .et_pb_row_inner -->
          
          
		</div>
		<!-- .et_pb_column -->


		<div class="et_pb_column et_pb_column_1_4 et_pb_css_mix_blend_mode_passthrough et_pb_column_single">
			<div class="et_pb_module et_pb_countdown_timer et_pb_bg_layout_light et_pb_no_bg et_pb_with_border" data-end-timestamp="[wpv-post-field name='we_startdate']">
				<div class="et_pb_countdown_timer_container clearfix">
					<h4 class="title">[wpv-post-title]</h4>
 					<div class="days section values" data-short="Day" data-full="Day(s)">
						<p class="value">00</p>
						<p class="label">Day</p>
					</div>
					<div class="sep section"><p>:</p></div>
					<div class="hours section values" data-short="Hrs" data-full="Hour(s)">
						<p class="value">00</p>
						<p class="label">Hrs</p>
					</div>
					<div class="sep section"><p>:</p></div>
					<div class="minutes section values" data-short="Min" data-full="Minute(s)">
						<p class="value">00</p>
						<p class="label">Min</p>
					</div>
					<div class="sep section"><p>:</p></div>
					<div class="seconds section values" data-short="Sec" data-full="Second(s)">
						<p class="value">00</p>
						<p class="label">Sec</p>
					</div>
				</div>
			</div>
			<div class="et_pb_button_module_wrapper et_pb_module et_pb_button_alignment_center">
				<a class="et_pb_button et_pb_module et_pb_bg_layout_light blue" href="#">Book Now</a>
			</div>
		</div>
		<!-- .et_pb_column -->
	</div>
	<!-- .et_pb_row -->
</div>
#605458

Nigel
Supporter

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

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

Hi Tim

Thanks for reporting this.

I just tried it on a vanilla site locally and it works as expected, I couldn't reproduce the problem you describe.

So I suspect there is some conflict with 3rd party code, from another plugin or the theme, which is causing this.

I know you have a workaround in place and don't need to, but if you have time you could try a no-conflict test by changing theme to twentyseventeen and disabling other plugins to see if you can identify a conflict.

#605471

Hi Nigel
It worked OK with normal post parent relationships, but it stopped working right when I switched to the newest beta of Views.

I'll have a go on a copy of the site later on.

Cheers
Tim

#605478

Nigel
Supporter

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

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

Sorry, I hadn't noticed this was with the betas.

Let me test again.

#605658

Nigel
Supporter

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

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

Hi Tim

I re-tested with the betas and still couldn't reproduce the problem.

I suspect it is because you have added the betas to an existing site.

If you create relationships with the beta, then when you use the Fields and Views button to insert the shortcode for the featured image and specify the parent post type, it no longer uses the id="$parent-slug" format, it instead looks something like this:

[wpv-post-featured-image size="medium" item="@project-task.parent"]

Even if I swap that for the old-style id attribute I still don't get the issue, but I created the relationship and the sample posts with the beta.

What, if anything, did you do to transition from the current stable versions to the betas for your post relationships and content?

#608177

Hi Nigel

Sorry for the delay in replying.
I'll try switching the code I'm using and see what happens.

To upgrade I just switched to the beta selection in the toolset updates page and it did it automatically. I then enabled the relationships in the settings and went from there.

I'll report back on whether the change of code helps.

#608496

Nigel
Supporter

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

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

OK Tim

Let me know.

It sounds like you just followed the expected steps. If you still see the problem let me know and I'll get a copy of your site for testing, in case something is missed by the wizard that updates relationships.

#608733

Hi Nigel

I've tried with the new code the but the problem persists in my version. I now suspect it's because I have views within views that are messing with the ids. I've created a copy of the site so you can see it in all its glory....

Can I send you login details privately.

Thanks
Tim

#608942

Nigel
Supporter

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

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

Hi Tim

Sorry for the delay, yes, let me set your next reply to get your credentials and I can take a look, and make a copy of your site if needs be.

#609319

Nigel
Supporter

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

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

Hi Tim

Thanks for the credentials. Upon examining your content template I was able to understand specifically what causes the issue and reproduce it on a clean test site, and so I have escalated this thread and fed the information to our developers.

I'll keep you posted when I have something to report.

#614109

Nigel
Supporter

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

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

Hi Tim

Reviewing the internal tickets I don't see a fix for this yet, but there is a workaround suggested, which is to force the correct post id, like so:

[wpv-post-title item="[wpv-post-id]"]

I'll keep you posted when the issue itself is resolved.

#618348

Nigel
Supporter

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

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

Hi Tim

We published updated versions of the betas yesterday, and if you upgrade you should find this issue is fixed.

#618373

Thanks Nigel.

Now I've just gone into the copy site I shared with you in the Privat message and updated to the latest Beta. It does seem to have fixed the issue.

However I now get errors at the top of each seminar page.
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'gutenberg_wpautop' not found or invalid function name in /home/time3842/public_html/btftypes/wp-includes/class-wp-hook.php on line 286

If I revert to production versions the error goes away.

I guess that's not actually related to the same issue but something to do with the preparation for the gutenburg editor?? Weird that the errors only appear when I update to the Betas though.

#618624

Nigel
Supporter

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

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

Hi Tim

These betas also include support for Gutenberg (https://toolset.com/2018/02/types-views-and-cred-betas-with-post-relationships-and-repeating-field-groups/), but they neglected to actually test if Gutenberg is installed 🙁

There should be a quick fix for that soon with another minor update.

Sorry for the inconvenience.

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