Page 1 of 1

Always show record count

PostPosted: Sat May 14, 2011 4:30 pm
by gbyerly
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.

Re: Always show record count

PostPosted: Sun May 15, 2011 12:57 pm
by shannah
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}


Re: Always show record count

PostPosted: Sun May 15, 2011 5:48 pm
by gbyerly
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

Re: Always show record count

PostPosted: Mon May 16, 2011 9:07 am
by shannah
What version of Xataface are you using (apart from the updated Application.php file and template)?

Re: Always show record count

PostPosted: Mon May 16, 2011 11:00 am
by gbyerly
1.2.6 1955

Re: Always show record count

PostPosted: Mon May 16, 2011 11:04 am
by shannah
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.

Re: Always show record count

PostPosted: Mon May 16, 2011 11:24 am
by gbyerly
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

Re: Always show record count

PostPosted: Mon May 16, 2011 1:11 pm
by shannah
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.

Re: Always show record count

PostPosted: Mon May 16, 2011 1:47 pm
by gbyerly
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

Re: Always show record count

PostPosted: Mon May 16, 2011 2:02 pm
by shannah
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