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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Form action value in CiviCRM form markup is suddenly wrong: "index.php"
Pages: [1]

Author Topic: Form action value in CiviCRM form markup is suddenly wrong: "index.php"  (Read 1978 times)

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
Form action value in CiviCRM form markup is suddenly wrong: "index.php"
August 14, 2008, 09:39:07 am
Anybody with a quick pointer as to what code generates the <form action=""> markup/values for CiviCRM forms (search form, settings forms, etc.)?

My 2.0.5 installation has been working fine for a couple of months, and all of a sudden all of the form action values are screwed up. Example:

URL: http://www.ipa.org/civicrm/contact/search/basic?reset=1
<form  action="/index.php" method="post" name="Basic" id="Basic" >

That *should be* (looking at other 2.0 installations I have:
<form  action="http://www.ipa.org/civicrm/contact/search/basic" method="post" name="Basic" id="Basic" >

The result is that search form is just sending the user back to the front page.

I've tried checking the CIVICRM_BASEURL setting in civicrm.settings.php, I've tried clearing the directories/smarty stuff via the debug option (which I had to turn on by editing civicrm_domain in the db due to the form submission problem), I've tried manually deleting the template files, I've tried checking the civicrm_domain values to make sure the domain URLs are set up properly.

This was working last night at 5AM or so, and now without me making any changes, it does not work.

I don't think this is some sort of rewrite problem, since the actual markup itself generated by CiviCRM is wrong. I don't see how this can be CiviCRM's fault either, because I've never seen this before, but I don't know what else could be involved in the process of generating that markup.

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
Re: Form action value in CiviCRM form markup is suddenly wrong: "index.php"
August 14, 2008, 10:18:43 am
progress so far: line 839 of CRM/Core/Form.php printed out the $content variable, and it included the attribute:

Code: [Select]
[attributes] =>  action="/index.php" method="post" name="Basic" id="Basic"
So the "attributes" attribute is set incorrectly, but where is that one set?

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
Re: Form action value in CiviCRM form markup is suddenly wrong: "index.php"
August 14, 2008, 10:38:09 am
There is something more than the form action markup going on. I edited CRM/Core/Form.php toSmarty() to hard-code the attributes['action'] value that I am expecting for the basic search form, resulting in this markup:

<form  action="http://www.ipa.org/civicrm/contact/search/basic" method="post" name="Basic" id="Basic" >

However, submitting that form still redirects to:

http://www.ipa.org/index.php?_qf_Basic_display=true&qfKey=f9bce31901de43d5e9da4db9a727edd5

Ack.

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
Re: Form action value in CiviCRM form markup is suddenly wrong: "index.php"
August 14, 2008, 04:11:03 pm
It looks to me like my server is not actually calling HTML_QuickForm() where it should. Starting with CRM/Core/Controller.php, the form request bounces through packages/HTML/QuickForm/Page.php and should end up calling HTML_QuickForm() in packages/HTML/QuickForm.php but in my testing the code is not actually being called.

Code: [Select]
$$stateName =& new $className( $stateMachine->find( $className ), $action, 'post', $formName );
|--> $this->HTML_QuickForm_Page( $this->_name, $method );
|--> $this->HTML_QuickForm($formName, $method, '', $target, $attributes);

the form action value should be derived from this line in QuickForm.php:

$action = CRM_Utils_System::postURL( $action );

But that's not being actively called (I can modify the code but nothing happens, where the same modification on another server works). Lobo thinks this is a PHP problem, potentially due to my not-current version of 5.2.5. However, the ISP (mediatemple) says there is no PHP optimizer, accelerator other other code caching present on that server that would explain this behavior.

I have an upgrade to PHP 5.2.6 that should happen tonight, we'll see.

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
Re: Form action value in CiviCRM form markup is suddenly wrong: "index.php"
August 27, 2008, 11:33:40 am
FYI, the cause of this looks to be outside of CiviCRM.

I had put a workaround to a different problem I was experiencing (PHP's include_path value not being set and retained properly) in Apache's httpd.conf file. This set something like "php_admin_value include_path ###" where ### was the include_path that CiviCRM needs in order to work.

Somehow this was causing the problem I describe here. Taking it out of httpd.conf (plus a PHP upgrade to 5.2.6 which meant I no longer needed the workaround) solved the problem.

I have no idea how those two things are connected (the httpd.conf settings and the weird behavior with QuickForm code not being evaluated), but there you go.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Form action value in CiviCRM form markup is suddenly wrong: "index.php"

This forum was archived on 2017-11-26.