Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Sorry if I misunderstood something but when I add orderby='weight' - the code below stops working and webpage responds with: Fatal error: Call to undefined method KError::set_sort() in /admin/folder.php on line 355. Thank you in advance!

PS: using latest CouchCMS build

Code: Select all
<cms:folders masterpage="<cms:show v_lang />/service.php" hierarchical='1' extended_info='1' >
  <cms:if k_element_start >
    <cms:if k_folder_immediate_children >
      <div class="h<cms:add "<cms:show k_level />" '1' /> trigger">
        <span>
          <cms:show k_folder_title />
        </span>
      </div>
      <div class="cont">
    <cms:else />
      <div class="h<cms:add "<cms:show k_level />" '1' /> trigger">
        <span>
          <cms:show k_folder_title />
        </span>
      </div>
      <div class="cont">
      <cms:pages masterpage="<cms:show v_lang />/service.php" folder=k_folder_name include_subfolders='0' >
          <div class="price-item">
            <table>
              <tbody>
                <tr>
                  <td class="price-title"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></td>
                  <td class="price-term">
                    <pre>
                      <cms:capture into='time_rep' >
                        <cms:show_repeatable 'price_and_time' >
                          <cms:if time_more >
                            <cms:show time_more /><br/>
                          </cms:if>
                        </cms:show_repeatable>
                      </cms:capture>
                      <cms:if "<cms:not_empty time_rep />" >
                        <cms:show time_rep />
                      <cms:else />
                        <cms:show total_time />
                      </cms:if>
                    </pre>
                  </td>
                  <td data-param="<cms:show k_page_title />" data-modal="#request-service" class="price-value">
                    <pre>
                      <cms:capture into='price_rep' >
                        <cms:show_repeatable 'price_and_time' >
                          <cms:if price_more >
                            <cms:show price_more /><br/>
                          </cms:if>
                        </cms:show_repeatable>
                      </cms:capture>
                      <cms:if "<cms:not_empty price_rep />" >
                        <cms:show price_rep />
                      <cms:else />
                        <cms:show price />
                      </cms:if>
                    </pre>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </cms:pages>
      </div>
    </cms:if>
  </cms:if>
  <cms:if k_level_end >
    </div>
  </cms:if>
</cms:folders>
Hi,

I tested your code and could reproduce the error.
So, it looks like you discovered a bug :)

Thanks for reporting it. I'll look into it and let you know once I am able to fix it.
Hi again,

I have made some changes to Couch's code.
Could you please apply the fix and let me know if it solves the problem you reported?
I'll commit the changes to GitHub once I get your response.

Here is the proposed fix -
Please edit couch/folder.php and at line 352 you'll find the following block -
Code: Select all
// check if 'order'by and 'order' have changed
if( $this->cmp_field!=$orig_cmp_field || $this->cmp_order!=$orig_cmp_order ){
    $this->root->set_sort( $orig_cmp_field, $orig_cmp_order );
    $this->root->sort(1);
}

Modify it to make it as follows -
Code: Select all
// check if 'order'by and 'order' have changed
if( $this->cmp_field!=$orig_cmp_field || $this->cmp_order!=$orig_cmp_order ){
    $this->children[$x]->root->set_sort( $orig_cmp_field, $orig_cmp_order );
    $this->children[$x]->root->sort(1);
}

Do let me know how it goes.

Thanks.
I've tested the proposed fix and it seems to work as expected! Thank you so much. KK, you saved my day :)
Thanks for the confirmation :)
I'll commit the change now to GitHub.
5 posts Page 1 of 1
cron