CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Pre-form Help text in preview mode of profile only, why?
Pages: [1]

Author Topic: Pre-form Help text in preview mode of profile only, why?  (Read 2963 times)

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Pre-form Help text in preview mode of profile only, why?
January 20, 2011, 09:19:24 am
Q from our application support people: They have created a at this URL: /civicrm/admin/uf/group&reset=1
With the following attributes:
Code: [Select]
Profile Title                             Type           ID  Used For               Enabled?  Reserved
Search Ministries, Meetings, Counselors Organization 3 Profile, Search Results Yes No

When we click the "more" link for this profile page, then "preview", the resulting form has the text from the "Pre-form Help" field.

However the live run-time version of the same form does not have the text form the "Pre-form Help" field.

What's more, the help for that field on the profile settings screen seems to suggest that it will not be shown on search pages. But why then would it show up for the "preview" mode and disappear for "run-time" mode?
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Pre-form Help text in preview mode of profile only, why?
March 10, 2011, 02:31:26 pm
I guess I asked about this some time ago... We have not found a solution to this yet.

I did a bit of grep'ing again the code searching for clues. The data that ends up missing on run-time forms is contained in: $help_pre Thus:

Code: [Select]
$ grep -r \$help_pre *|grep -v joomla
CRM/Price/DAO/Field.php:    public $help_pre;
CRM/Price/DAO/Set.php:    public $help_pre;
CRM/Core/DAO/CustomGroup.php:    public $help_pre;
CRM/Core/DAO/UFField.php:    public $help_pre;
CRM/Core/DAO/UFGroup.php:    public $help_pre;
CRM/Core/DAO/CustomField.php:    public $help_pre;
templates/CRM/Profile/Form/Dynamic.tpl:    {if $help_pre && $action neq 4}
templates/CRM/Profile/Form/Dynamic.tpl:        <div class="messages help">{$help_pre}</div>
templates/CRM/Campaign/Form/Petition/Block.tpl:   {if $help_pre && $action neq 4}<div class="messages help">{$help_pre}</div>{/if}
templates/CRM/UF/Form/Block.tpl:   {if $help_pre && $action neq 4}<div class="messages help">{$help_pre}</div>{/if}
templates/CRM/UF/Form/Preview.tpl:    {if $help_pre && $action neq 4}<div class="messages help">{$help_pre}</div>{/if}

I think it likely that the Profile with search capabilities comes from the file templates/CRM/Profile/Form/Dynamic.tpl

I tried removing the "&& $action neq 4" from that IF block to see if that was preventing the help text from showing up at runtime, and that made no difference.

Could someone kindly point me at where this behavior is coming from in the code so I may patch it? (Fix it!) Thank you!
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Pre-form Help text in preview mode of profile only, why?
March 10, 2011, 06:13:25 pm
All right, getting a better understanding of Civi Profiles.

It would appear that the file: templates/CRM/Profile/Form/Dynamic.tpl is used to generate the preview mode of that screen... the profile with search capabilities.
However the file templates/CRM/Profile/Form/Search.tpl is used for the run-time mode.

I have added the $help_pre variable code to the Search.tpl and I am getting an empty box. I assume that the $help_pre variable is not getting set for Search.tpl but is set for Dynamic.tpl

How do I take care of getting $help_pre variable set for the Search.tpl file as well?
« Last Edit: March 10, 2011, 06:15:27 pm by mdlueck »
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Pre-form Help text in preview mode of profile only, why?
March 10, 2011, 07:45:31 pm

hey mdlueck:

can u jump on irc tomorrow and we can take a look and hopefully help you tackle this issue and resovle it

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Pre-form Help text in preview mode of profile only, why?
March 11, 2011, 04:27:12 am
Thanks Lobo!  ;D

I am headed off this morning with a school field trip. If I get back early enough I will try this afternoon. If not, then definitely soon.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Pre-form Help text in preview mode of profile only, why?
March 15, 2011, 01:21:51 pm
According to lobo, both the pre/post form help variables will be exposed by the PHP code which use this Search.tpl file in the upcoming 3.4 release of Civi.

So I have decided to hang onto my patch to Search.tpl and test re-applying it to that file once we are daring enough to migrate to a release of 3.4 while it is still a work-in-progress. So that means at some point in the near future.

I will come back to update this thread at that point in time.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Pre-form Help text in preview mode of profile only, why?
June 30, 2011, 07:00:22 pm
Very frustrating evening...  :'(

I am back trying to get the pre form help text to show up. I have patched the Search.tpl, cleared the templates_c directory, I can see my help text tags in the complied version of Search.tpl under templates_c.

I even hacked in a "This is a test!" as well and that shows up in templates_c... however I do not see such text on the run-time Search Profile.

Hints as to what I am missing? Seems I am so close, yet having less success this evening than when we were on 3.3.x.

Attached is what I added to Search.tpl in diff format.

P.S. And yes, testing with Civi 3.4.4... have not rolled it to production yet, thus I have not updated my vital stats.
« Last Edit: June 30, 2011, 07:02:30 pm by mdlueck »
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Pre-form Help text in preview mode of profile only, why?
July 01, 2011, 03:11:17 pm
eileen suggested searching for "tpl" in the html of the profile to see which file generates the profile. I did and found:

Code: [Select]
<!-- .tpl file invoked: CRM/Profile/Page/Listings.tpl. Call via form.tpl if we have a form in the page. -->
    <form  action="/civicrm/profile" method="post" name="Search" id="Search" >

So very excitedly I went off in the direction of that file. That file has in it the following code:

Code: [Select]
{if $search}
<div class="crm-block crm-form-block">
{include file="$searchTPL"}
</div>
{/if}

I guess right back to where I started... Search.tpl

Any other suggestions? Thanks!
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Pre-form Help text in preview mode of profile only, why?
July 01, 2011, 06:50:44 pm
I figured out the trouble... I keep getting redirected back to the production domain. gggrrr...

Seems the $field.help_pre variable is still not getting set by CiviCRM 3.4.4. I commented out the {if} block to force it to go in, and indeed it was set to null.

So I got the idea to copy/paste the preform help and stick it right in this template file! ddduuuaaa...  ;)

Attached is the ugly fix. I would rather this variable get set so I can take the ugly hack back out and just have a minor hack to this template.

On to testing further things in the effort to get back to running current CiviCRM.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Pre-form Help text in preview mode of profile only, why?
July 07, 2011, 06:38:32 pm
I rolled the patch (more or less) to our production Civi 3.3.6 installation. It may be seen here: http://christians-in-recovery.org/MinistryDatabase

The one big minus with having to hack the pre-form-help into the template is that we can only have one Profile with Search capabilities... or all of the other Profile pages will have the same exact pre-form-help text.

Could someone look into the Civi 3.4.x code base and see what got missing that Lobo thought was included? Lobo made it sound like my patch would work on Civi 3.4.x.

Thanks!
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Pre-form Help text in preview mode of profile only, why?

This forum was archived on 2017-11-26.