Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add type cast #3

Closed
wants to merge 2 commits into from
Closed

Conversation

davidjosephhayes
Copy link

$component_page_type was null causing a fatal error on a fresh install of 4.6.2

@mlutfy
Copy link
Owner

mlutfy commented Apr 23, 2015

Thanks for the PR!

Could you explain the following change? To be honest, I'm not sure myself what it was for initially.

`

  •  $('#Campaign .crm-contribution-form-block-title').hide();
    
  •  //~ $('#Campaign .crm-contribution-form-block-title').hide();
    
    `

Also, the CSS classes added, that's for the Bootstrap theme, right? (we've been debating whether to add Bootstrap classes in CiviCRM more generally, as the main officially supported theme)

@davidjosephhayes
Copy link
Author

I apologize. I only meant to put the change to pcpteams.inc.php where the variable is type cast to a string. In 4.6, pcpteams_getteamnames seems to be called with $component_page_type null by default. This causes a fatal error when putting it in the db query

The other changes were to a my project specifically. I did not mean to include them in the pull request. I am working through the CiviCRM templates and adding Bootstrap 3 classes as I need them: https://github.com/blackbricksoftware/civicrm-core

@eruraindil
Copy link

@mlutfy Can confirm @davidjosephhayes bug, on civicrm 4.6.4 cannot edit pcp individual pages without the above type cast, causes fatal error.

backTrace

#0 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Core/Error.php(380): CRM_Core_Error::backtrace()
#1 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Core/DAO.php(1215): CRM_Core_Error::fatal(" is not of type String")
#2 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Core/DAO.php(1102): CRM_Core_DAO::composeQuery("\n    SELECT pcp.id, pcp.title\n      FROM civicrm_pcp_team t\n      LEFT JOI...", (Array:3), TRUE)
#3 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Extension/ca.bidon.pcpteams-master/pcpteams.inc.php(183): CRM_Core_DAO::executeQuery("\n    SELECT pcp.id, pcp.title\n      FROM civicrm_pcp_team t\n      LEFT JOI...", (Array:3))
#4 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Extension/ca.bidon.pcpteams-master/pcpteams.php(198): pcpteams_getteamnames(NULL, "5")
#5 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Extension/ca.bidon.pcpteams-master/pcpteams.php(80): pcpteams_civicrm_buildForm_CRM_PCP_Form_Campaign(Object(CRM_PCP_Form_Campaign))
#6 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Utils/Hook.php(198): pcpteams_civicrm_buildForm("CRM_PCP_Form_Campaign", Object(CRM_PCP_Form_Campaign))
#7 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php(80): CRM_Utils_Hook->runHooks((Array:82), "civicrm_buildForm", 2, "CRM_PCP_Form_Campaign", Object(CRM_PCP_Form_Campaign), NULL, NULL, NULL, NULL)
#8 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Utils/Hook.php(315): CRM_Utils_Hook_DrupalBase->invoke(2, "CRM_PCP_Form_Campaign", Object(CRM_PCP_Form_Campaign), NULL, NULL, NULL, NULL, "civicrm_buildForm")
#9 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Core/Form.php(467): CRM_Utils_Hook::buildForm("CRM_PCP_Form_Campaign", Object(CRM_PCP_Form_Campaign))
#10 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(93): CRM_Core_Form->buildForm()
#11 /home/<USER>/public_html/site/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_PCP_Form_Campaign), "display")
#12 /home/<USER>/public_html/site/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_PCP_Form_Campaign), "display")
#13 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Core/Controller.php(356): HTML_QuickForm_Page->handle("display")
#14 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/PCP/Page/PCPInfo.php(328): CRM_Core_Controller->run()
#15 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Core/Invoke.php(331): CRM_PCP_Page_PCPInfo->run((Array:3), NULL)
#16 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Core/Invoke.php(75): CRM_Core_Invoke::runItem((Array:13))
#17 /home/<USER>/public_html/site/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#18 /home/<USER>/public_html/site/sites/all/modules/civicrm/drupal/civicrm.module(457): CRM_Core_Invoke::invoke((Array:3))
#19 [internal function](): civicrm_invoke("pcp", "info")
#20 /home/<USER>/public_html/site/includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:2))
#21 /home/<USER>/public_html/site/index.php(21): menu_execute_active_handler()
#22 {main}

@mlutfy
Copy link
Owner

mlutfy commented Sep 1, 2015

@eruraindil Thanks for the backtrace. Did you encounter this issue when working with Event PCPs or Contributions? I tested contributions and it seems OK.

The component page type should never be null, it should be either "contribution" or "event". Otherwise I worry it might cause issues down the road.

(sorry for the very late response)

mlutfy added a commit that referenced this pull request Sep 1, 2015
@mlutfy
Copy link
Owner

mlutfy commented Sep 1, 2015

Nevermind my last comment. I see the bug in Contribution pages as well.

I'm a bit surprised that allowing a null/empty works. Can you test 87168de ?

@mlutfy mlutfy closed this Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants