Skip Navigation

[Gelöst] Views causing 502 error (wpv-if?)

This support ticket is created vor 9 Jahre. 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
- 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

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

This topic contains 7 Antworten, has 2 Stimmen.

Last updated by chrisH-10 vor 9 Jahre.

Assigned support staff: Caridad.

Author
Artikel
#186827

Hi, in this ticket (https://toolset.com/forums/topic/view-causing-502-error/) you flagged the issue to be a wpv-if statement or the nesting thereof. Alas you didn't explain what the issue was. Here's the code that I think is having the issue.

[wpv-layout-start]
	[wpv-items-found]
	<div class="full-block content-block">
		<!-- wpv-loop-start -->
		<wpv-loop wrap="2">
          
          [wpv-if drawerstyle="wpcf-drawer-style" evaluate="$drawerstyle = '1col'"]
          <!-- 1col layout -->
          <div class="block">
              <div class="container">
                <div class="row">
                  <div class="col-md-12">
                    [wpv-if drawerstyle="wpcf-drawer-image" evaluate="$drawerstyle != ''" debug="false"]
                    <img src="[types field="drawer-image" size="full" url="true"][/types]" alt="" class="img-banner img-responsive">
                    <br>
                    [/wpv-if]
                    [types field="drawer-text" output="raw"][/types]
                  </div>
                </div>
              </div>
          </div>
          [/wpv-if] 
          
          [wpv-if drawerstyle="wpcf-drawer-style" evaluate="$drawerstyle = '2col-l' or $drawerstyle = '2col-r'" debug="false"]
          <!-- 2col-X layout -->
          <div class="block">
              <div class="container">
                  <div class="row">
                      <div class="col-md-6 col-sm-5[wpv-if drawerstyle="wpcf-drawer-style" evaluate="$drawerstyle = '2col-r'" debug="false"] pull-right pull-xs[/wpv-if]">
                          <div class="row">
                              <img src="[types field="drawer-image" size="full" url="true"][/types]" alt="" class="img-banner center-block img-banner-xs">
                          </div>
                      </div>
                      <div class="col-md-6 col-sm-7">
                          [types field="drawer-text" output="raw"][/types]
                      </div>
                  </div>
              </div>
          </div>
		  [/wpv-if] 
          
          [wpv-if drawerstyle="wpcf-drawer-style" evaluate="$drawerstyle = 'raw'" debug="false"]
    	  <!-- Raw layout -->
            [types field="drawer-text" output="raw"][/types]
          [/wpv-if]   
          
          [wpv-if drawerstyle="wpcf-drawer-style" evaluate="$drawerstyle = 'bio-l' or $drawerstyle = 'bio-r'"]
          <!-- Bio layout -->
          <div class="block">
              <div class="container">
                  <div class="row">
                      <div class="col-md-4 col-sm-4[wpv-if drawerstyle="wpcf-drawer-style" evaluate="$drawerstyle = 'bio-r'"] pull-right pull-xs[/wpv-if]">
                          <div class="photo">
                              <div class="photo-img"><img src="[types field="drawer-image" size="full" url="true"][/types]" alt="" class="img-banner img-circle center-block img-responsive"></div>
                          </div>
                      </div>
                      <div class="col-md-8 col-sm-8">
                          [types field="drawer-text" output="raw"][/types]
                      </div>
                  </div>
              </div>
          </div>
          [/wpv-if]   
          
		</wpv-loop>
	<!-- wpv-loop-end -->
	</div>
	[/wpv-items-found]
	[wpv-no-items-found]
		[wpml-string context="wpv-views"]<strong>No items found</strong>[/wpml-string]
	[/wpv-no-items-found]
[wpv-layout-end]
#186973

Dear Chris,

On the thread you mention, he had the wpv-if shortcode outside the loop, but yours are correct.

502 error message is very generic and can be caused by a number of different things. Can you confirm that nesting is the problem? Temporary remove the nested wpv-if's to see if it works.

Regards,
Caridad

#187049

I've removed all nested IF statements and the issue persists (code below). Perhaps this was a red herring. I do know that this issue only started happening after the WP 3.8 upgrade.

[wpv-layout-start]
	[wpv-items-found]
	<div class="full-block content-block">
		<!-- wpv-loop-start -->
		<wpv-loop wrap="2">
          
          [wpv-if drawerstyle="wpcf-drawer-style" evaluate="$drawerstyle = '1col'"]
          <!-- 1col layout -->
          <div class="block">
              <div class="container">
                <div class="row">
                  <div class="col-md-12">
                    [types field="drawer-text" output="raw"][/types]
                  </div>
                </div>
              </div>
          </div>
          [/wpv-if] 
          
          [wpv-if drawerstyle="wpcf-drawer-style" evaluate="$drawerstyle = '2col-l' or $drawerstyle = '2col-r'" debug="false"]
          <!-- 2col-X layout -->
          <div class="block">
              <div class="container">
                  <div class="row">
                          <div class="row">
                              <img src="[types field="drawer-image" size="full" url="true"][/types]" alt="" class="img-banner center-block img-banner-xs">
                          </div>
                      </div>
                      <div class="col-md-6 col-sm-7">
                          [types field="drawer-text" output="raw"][/types]
                      </div>
                  </div>
              </div>
          </div>
		  [/wpv-if] 
          
          [wpv-if drawerstyle="wpcf-drawer-style" evaluate="$drawerstyle = 'raw'" debug="false"]
    	  <!-- Raw layout -->
            [types field="drawer-text" output="raw"][/types]
          [/wpv-if]   
          
          [wpv-if drawerstyle="wpcf-drawer-style" evaluate="$drawerstyle = 'bio-l' or $drawerstyle = 'bio-r'"]
          <!-- Bio layout -->
          <div class="block">
              <div class="container">
                  <div class="row">
                          <div class="photo">
                              <div class="photo-img"><img src="[types field="drawer-image" size="full" url="true"][/types]" alt="" class="img-banner img-circle center-block img-responsive"></div>
                          </div>
                      </div>
                      <div class="col-md-8 col-sm-8">
                          [types field="drawer-text" output="raw"][/types]
                      </div>
                  </div>
              </div>
          </div>
          [/wpv-if]   
          
		</wpv-loop>
	<!-- wpv-loop-end -->
	</div>
	[/wpv-items-found]
	[wpv-no-items-found]
		[wpml-string context="wpv-views"]<strong>No items found</strong>[/wpml-string]
	[/wpv-no-items-found]
[wpv-layout-end]
#187052

I should note that this is an intermittent issue, but it happens a lot. The live site can be found here:
hidden link

#187365

Dear Chris,

You wont happen to be on a 3G connection?

Regards,
Caridad

#187380

No, this is from various offices around Boston, MA and I also tried from a data center (really big pipes) in Kansas. The site is hosted on WPEngine.

#188361

Dear Chris,

I think WPEngine might have a caching system that is timiing out. Your page is taking too long to respond and the cache is timing out. Can you find if this is true from WPEngine?

If its not a cache, it might be a load balancer or something similar. I'm glad to say that next release will include performance improvements.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Regards,
Caridad

#188373

This issue appears to have been resolved. WPEninge did say they had heavy load and made sure we had more resources.

Performance improvements are always appreciated!