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

[Joomla 4.0] Fatal error on submitting Profile with CMS username/password #23549

Merged
merged 1 commit into from
May 25, 2022

Conversation

monishdeb
Copy link
Member

Overview

Steps to replicate:
- Choose any Profile and enable 'User Registration'
- Open the Profile in create mode and submit as a anonymous user.

Before

Result: Fatal error and the joomla user account is not created

After

CMS User and civicrm contact is created successfully

Comments

Ref : https://lab.civicrm.org/dev/joomla/-/issues/39

@civibot
Copy link

civibot bot commented May 23, 2022

(Standard links)

@civibot civibot bot added the master label May 23, 2022

if (version_compare(JVERSION, '4.0.0', 'ge')) {
$model = JFactory::getApplication()->bootComponent('com_users')->getMVCFactory()->createModel('Registration', 'Site');
$model->set('data', new \stdClass);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monishdeb can you change this to

Suggested change
$model->set('data', new \stdClass);
$model->set('data', new \stdClass());

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm didn't know that stylechecker didn't allow the without parenthesis new class declaration like here

Updating now.

@vingle
Copy link
Contributor

vingle commented May 24, 2022

This fixes the problem for Joomla 4 for me, and doesn't impact account creation profile pages on Joomla 3.

@monishdeb
Copy link
Member Author

Thanks @vingle for reviewing this fix.

@mlutfy @eileenmcnaughton @colemanw can you please review/merge this PR.

@eileenmcnaughton
Copy link
Contributor

Since this only affects Joomla! I am happy to merge based on @vingle review - thanks @monishdeb @vingle

@eileenmcnaughton eileenmcnaughton merged commit 5679f4c into civicrm:master May 25, 2022
@monishdeb monishdeb deleted the issue_39 branch May 26, 2022 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants