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

generate:form gives PHP Fatal error: Uncaught TypeError: Return value of "CRM\CivixBundle\Command\AddFormCommand::execute()" must be of the type int, "null" returned. in ...\vendor\symfony\console\Command\Command.php:301 #304

Merged
merged 3 commits into from
Jul 24, 2023

Conversation

demeritcowboy
Copy link
Contributor

@demeritcowboy demeritcowboy commented Jul 23, 2023

In this case I'm using php 8.1 and civix built from source.

It's very similar to https://lab.civicrm.org/dev/civicrm-asset-plugin/-/merge_requests/8/diffs in that more recent versions of symfony require execute() to return an int: https://github.com/symfony/console/blob/v5.4.5/Command/Command.php#L301. And older versions wouldn't care if it's 0 or null.

@civicrm-builder
Copy link
Collaborator

Can one of the admins verify this patch?

@totten
Copy link
Owner

totten commented Jul 23, 2023

civibot, add to whitelist

@totten
Copy link
Owner

totten commented Jul 24, 2023

@demeritcowboy Was there a reason for targeting this command specifically? It looked like other commands would have same issue. I pushed what I expect them to need.

Aside: If your environment can run it, it might be nice to see if this command works:

cd civix
export CIVIX_WORKSPACE=/path/to/sites/all/modules/civicrm/ext/civixtest 
bash scripts/make-snapshots.sh --src --keep kitchensink

That will create a "kitchensink" extension (with a little bit of code from all the generators). If any command still have a similar issue, then generating the kitchensink should fail.

@demeritcowboy
Copy link
Contributor Author

No it was just because that's what I was doing at the time.

That script wouldn't work for me but if it's just a matter of making a module and then running this list, then except for some warnings and the single quotes I had to change it all seems to work.

@totten
Copy link
Owner

totten commented Jul 24, 2023

@demeritcowboy Yup, that's exactly the list. Glad it worked.

@totten totten merged commit d4a7078 into totten:master Jul 24, 2023
@demeritcowboy demeritcowboy deleted the exec branch July 24, 2023 15:34
@demeritcowboy
Copy link
Contributor Author

Thanks!

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