Skip to content

TwingleShop: add setting for the financial type of additional donations#122

Open
MarcMichalsky wants to merge 2 commits intosystopia:masterfrom
MarcMichalsky:option_for_additional_donations
Open

TwingleShop: add setting for the financial type of additional donations#122
MarcMichalsky wants to merge 2 commits intosystopia:masterfrom
MarcMichalsky:option_for_additional_donations

Conversation

@MarcMichalsky
Copy link
Contributor

@MarcMichalsky MarcMichalsky commented Sep 29, 2025

I added a setting field for the financial type of additional donations.

As we learned in #102, the id of additional donations is always -22. The default financial type is 1, which should be "donation" in most cases.

Could you please test the PR @GFF-DS?

fix #102

@GFF-DS
Copy link
Contributor

GFF-DS commented Sep 30, 2025

Yes I can test the PR. Do you plan to fix the failed checks before manual testing?

@GFF-DS
Copy link
Contributor

GFF-DS commented Sep 30, 2025

I will not test the installation of the extension to a fresh CiviCRM installation. In a previous issue we had the problem, that some extra code was missing for the initial installation, to make the corresponding database schema changes. Is this covered by the pull request?

@MarcMichalsky
Copy link
Contributor Author

Hi @GFF-DS,

Do you plan to fix the failed checks before manual testing?

No, I don't plan to fix the failed tests. The code sniffer actually complains about the syntax throughout the entire file. If I were to fix all of that, this PR would no longer be anywhere near atomic. The PHPStan test fails already in the setup of the test environment.

In a previous issue we had the problem, that some extra code was missing for the initial installation, to make the corresponding database schema changes. Is this covered by the pull request?

No, it's not covered in this PR but was covered in this already merged PR: #114

@GFF-DS
Copy link
Contributor

GFF-DS commented Sep 30, 2025

No, I don't plan to fix the failed tests. The code sniffer actually complains about the syntax throughout the entire file. If I were to fix all of that, this PR would no longer be anywhere near atomic. The PHPStan test fails already in the setup of the test environment.

ok, thanks for the explanation!

In a previous issue we had the problem, that some extra code was missing for the initial installation, to make the corresponding database schema changes. Is this covered by the pull request?

No, it's not covered in this PR but was covered in this already merged PR: #114

ah, sorry, I mixed up that for new settings there is no need to adapt the database schema.

I will test the PR probably next week.

elseif ($product['id'] === -22) {
// Identify additional donations by their ID.
// See https://github.com/systopia/de.systopia.twingle/issues/102
elseif ($product['id'] === self::TWINGLE_ADDITIONAL_DONATION_ID) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perfect! Just nitpicking: this could preferably be a yoda condition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hurt my brain, the Yoda condition coding style does.

@MarcMichalsky
Copy link
Contributor Author

We should squash this PR before merging.

@GFF-DS
Copy link
Contributor

GFF-DS commented Oct 7, 2025

Currently, there is a msgid "Financial Type for top up donations", which currently is translated into german as "Zuwendungsart für zusätzliche Spenden".

The PR adds a msgid "Financial Type for additional donations", which I think is not translated in the PR (?).

My suggestion would be to

  1. Change the translation for "Financial Type for top up donations" into "Zuwendungsart für Zusatzbetrag (Top-up)", as this is the term Twingle uses in the Twinglemanager.
  2. Add a translation for "Financial Type for additional donations": "Zuwendungsart für Zusatzspende", as this is the term Twingle uses in the Twinglemanager.

I will continue testing and come back with a feedback about the functionality itself.

@GFF-DS
Copy link
Contributor

GFF-DS commented Oct 7, 2025

In terms of functionality, the PR works.

When in the twingle profile I choose "Produkte Preisfeldern zuordnen", save the profile and edit it again, the price fields are not loaded. However, I never used this feature, so that I don't know if I maybe don't use it correctly. For us, the general settings about the financial_type are sufficient.

@MarcMichalsky
Copy link
Contributor Author

  1. Change the translation for "Financial Type for top up donations" into "Zuwendungsart für Zusatzbetrag (Top-up)", as this is the term Twingle uses in the Twinglemanager.
  2. Add a translation for "Financial Type for additional donations": "Zuwendungsart für Zusatzspende", as this is the term Twingle uses in the Twinglemanager.

Yes, good point. I'll change that translation and add the new one. Thanks!

MarcMichalsky added a commit to MarcMichalsky/de.systopia.twingle that referenced this pull request Oct 9, 2025
- Adds a translation string for "Financial Type for additional donations".

- Improves German translations for additional and top up donations. See: systopia#122 (comment)
Allows specifying a financial type for additional donations.

Uses a constant for the fixed ID associated with additional donations and improves German translations for clarity.
@MarcMichalsky MarcMichalsky force-pushed the option_for_additional_donations branch from c91f744 to 184114d Compare October 9, 2025 14:22
@MarcMichalsky
Copy link
Contributor Author

I have updated the translations and squashed the commits.
I think it is now ready to be merged!

Copy link
Contributor Author

@MarcMichalsky MarcMichalsky left a comment

Choose a reason for hiding this comment

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

Ready to merge!

"Mitgliedschaftsobjekt erstellt, können Sie einen API-Aufruf (als "
"'Entität.Aktion') angeben, um neu erstellt Mitgliedschaften an die "
"Anforderungen Ihrer Organisation anzupassen."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't be confused. Poedit seems to have changed the line splitting a little. I could have discarded these changes, but they are probably included in the compiled .mo file, so I decided against it.

The issue was introduced in CiviCRM version 6.11.0
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.

Add TwingleShop setting for defining the contribution type of "additional donation"

3 participants