Always show record count

A place for users and developers of the Xataface to discuss and receive support.

Always show record count

Postby gbyerly » Sat May 14, 2011 4:30 pm

This is the "_prefs" section of the "conf.ini" file:

[_prefs]
;;horizontal_tables_menu=0
;;disable_select_rows=1
show_jump_menu=0
show_resultlist_controller_only_when_needed=0

Any of the tables in the app that have less than 30 records still do not show record count.
gbyerly
 
Posts: 21
Joined: Sun Apr 03, 2011 7:12 pm

Re: Always show record count

Postby shannah » Sun May 15, 2011 12:57 pm

Thanks for the bug report. I have fixed this in SVN. This is the diff of the change:
Code: Select all

stevepbook:Dataface shannah$ svn diff -r 2297:2298 http://weblite.ca/svn/dataface/core/trunk/
Index: Dataface/Application.php
===================================================================
--- Dataface/Application.php   (revision 2297)
+++ Dataface/Application.php   (revision 2298)
@@ -1021,6 +1021,7 @@
      if ( isset($applicationDelegate) and method_exists($applicationDelegate, 'getPreferences') ){
         $this->prefs = array_merge($this->prefs, $applicationDelegate->getPreferences());
      }
+      $this->prefs = array_map('intval', $this->prefs);
      
      // Check to make sure that this table hasn't been disallowed
      $disallowed = false;
Index: Dataface/templates/Dataface_List_View.html
===================================================================
--- Dataface/templates/Dataface_List_View.html   (revision 2297)
+++ Dataface/templates/Dataface_List_View.html   (revision 2298)
@@ -31,17 +31,21 @@
      {/if}
      <div id="list-window">
      {if !$ENV.prefs.use_old_resultlist_controller}
-         {if $ENV.resultSet->found() > $ENV.resultSet->limit()}
+         {if !$ENV.prefs.hide_resultlist_controller}
+         {if $ENV.resultSet->found() > $ENV.resultSet->limit() or !$ENV.APPLICATION_OBJECT->prefs.show_resultlist_controller_only_when_needed}
            {result_controller}
         {/if}
+         {/if}
      {/if}
      <div style="clear:both">
      {result_list}
      </div>
      {if !$ENV.prefs.use_old_resultlist_controller}
-         {if $ENV.resultSet->found() > $ENV.resultSet->limit()}
+         {if !$ENV.prefs.hide_resultlist_controller}
+         {if ($ENV.resultSet->found() > $ENV.resultSet->limit()) or !$ENV.APPLICATION_OBJECT->prefs.show_resultlist_controller_only_when_needed}
            {result_controller}
         {/if}
+         {/if}
      {/if}
      </div>
      {/define_slot}

shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Always show record count

Postby gbyerly » Sun May 15, 2011 5:48 pm

Steve,

I made the changes and the controller displays properly. Thank you.

When I attempt to use the Find tab to locate Active members only (which worked correctly before), I received the following message related to the related tables:

Failed to get field Tips_Given/TipId: 2Failed to get field Tips_Given/TipAmount: 2Failed to get field Tips_Given/TipDescription: 2Failed to get field Tips_Received/TipId: 2Failed to get field Tips_Received/TipAmount: 2Failed to get field Tips_Received/TipDescription: 2Failed to get field Members_Visited/VisitationId: 2Failed to get field Members_Visited/MonthYear: 2Failed to get field Members_Visited/DateCommercialGiven: 2Failed to get field Visited_By/VisitationId: 2Failed to get field Visited_By/MonthYear: 2Failed to get field Visited_By/DateCommercialGiven: 2
Warning: Cannot modify header information - headers already sent by (output started at /home/gbyerly/public_html/x/Dataface/SearchForm.php:332) in /home/gbyerly/public_html/x/Dataface/SearchForm.php on line 354


Glenn
gbyerly
 
Posts: 21
Joined: Sun Apr 03, 2011 7:12 pm

Re: Always show record count

Postby shannah » Mon May 16, 2011 9:07 am

What version of Xataface are you using (apart from the updated Application.php file and template)?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Always show record count

Postby gbyerly » Mon May 16, 2011 11:00 am

1.2.6 1955
gbyerly
 
Posts: 21
Joined: Sun Apr 03, 2011 7:12 pm

Re: Always show record count

Postby shannah » Mon May 16, 2011 11:04 am

Hmmm.

Did you update the whole Application.php file or just implement the changes outlined in the diff.
There have actually been a lot of changes between 1.2.6 and the current SVN trunk so if you just copied the whole file, it could have caused some incompatibilities.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Always show record count

Postby gbyerly » Mon May 16, 2011 11:24 am

Steve,

I was concerned about that too, so I just modified the two files, per your instructions. Is there any reason for me not to upgrade the entire xataface directory?

Glenn
gbyerly
 
Posts: 21
Joined: Sun Apr 03, 2011 7:12 pm

Re: Always show record count

Postby shannah » Mon May 16, 2011 1:11 pm

Those 2 mods shouldn't have caused the problems that you describe on their own. Try switching them back and confirm that the problem still exists.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Always show record count

Postby gbyerly » Mon May 16, 2011 1:47 pm

Steve,

1. You are correct. I renamed the revised files, pulled the originals from a backup directory, and restored them. I have one master table with four related tables. The find works properly on the related tables, but not on the master.

2. Is there any reason for me not to upgrade to the latest version?

Glenn
gbyerly
 
Posts: 21
Joined: Sun Apr 03, 2011 7:12 pm

Re: Always show record count

Postby shannah » Mon May 16, 2011 2:02 pm

No reason. If anything, the latest version is more stable than 1.2.6.

The error messages seem to indicate that it can't find fields by those names so it might be something to do with configuration/case-sensitivity in fields or relationship definitions.... and may persist with the latest version - hard to tell.

-STeve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 19 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved