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

Change Price paths #26929

Merged
merged 2 commits into from Jul 26, 2023
Merged

Change Price paths #26929

merged 2 commits into from Jul 26, 2023

Conversation

aydun
Copy link
Contributor

@aydun aydun commented Jul 25, 2023

Overview

Change paths for Price Sets, Price Fields and Price Field Values

Before

After

There should be no user-visible changes, but this allows the original URL's to be overridden by AdminUI.

Technical Details

This is similar to other path changes that have been done to accommodate AdminUI.

Comments

@civibot
Copy link

civibot bot commented Jul 25, 2023

Thank you for contributing to CiviCRM! ❤️ We will need to test and review the PR. 👷

Introduction for new contributors
  • If this is your first PR, an admin will greenlight automated testing with the command ok to test or add to whitelist.
  • A series of tests will automatically run. You can see the results at the bottom of this page (if there are any problems, it will include a link to see what went wrong).
  • A demo site will be built where anyone can try out a version of CiviCRM that includes your changes.
  • If this process needs to be repeated, an admin will issue the command test this please to rerun tests and build a new demo site.
  • Before this PR can be merged, it needs to be reviewed. Please keep in mind that reviewers are volunteers, and their response time can vary from a few hours to a few weeks depending on their availability and their knowledge of this particular part of CiviCRM.
  • A great way to speed up this process is to "trade reviews" with someone - find an open PR that you feel able to review, and leave a comment like "I'm reviewing this now, could you please review mine?" (include a link to yours). You don't have to wait for a response to get started (and you don't have to stop at one!) the more you review, the faster this process goes for everyone 😄
  • To ensure that you are credited properly in the final release notes, please add yourself to contributor-key.yml
  • For more information about contributing, see CONTRIBUTING.md.
Quick links for reviewers

@civibot civibot bot added the master label Jul 25, 2023
Comment on lines 10 to 14
<add>civicrm/admin/price/field/option/edit?reset=1&amp;action=add&amp;fid=[PriceFieldValue_PriceField_price_field_id_01.id]&amp;sid=[PriceFieldValue_PriceField_price_field_id_01.price_set_id]</add>
<view>civicrm/admin/price/field/option/edit?reset=1&amp;action=view&amp;oid=[id]&amp;fid=[price_field_id]&amp;sid=[PriceFieldValue_PriceField_price_field_id_01.price_set_id]</view>
<update>civicrm/admin/price/field/option/edit?reset=1&amp;action=update&amp;oid=[id]&amp;fid=[price_field_id]&amp;sid=[PriceFieldValue_PriceField_price_field_id_01.price_set_id]</update>
<delete>civicrm/admin/price/field/option/edit?reset=1&amp;action=delete&amp;oid=[id]&amp;fid=[price_field_id]&amp;sid=[PriceFieldValue_PriceField_price_field_id_01.price_set_id]</delete>
<browse>civicrm/admin/price/field/option</browse>
Copy link
Member

@colemanw colemanw Jul 26, 2023

Choose a reason for hiding this comment

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

@aydun it looks like this path is referencing an explicit join. Explicit joins don't have a stable name that can be referenced like this (since the name of the join is anything you want it to be when you call ->addJoin() in the API). Is it possible to do this with an implicit join, like [price_field_id.price_set_id]?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That does work for the view, update and delete links but not for the add one. Any chance you could tweak how things are processed for the add button to make that work?

Copy link
Member

Choose a reason for hiding this comment

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

The ADD button processes tokens differently than links, because it doesn't have any row data to use (it's not in a row) the only data it has for tokens is the incoming filters. I know this works for a few other pages, e.g Custom Fields has an incoming filter by custom_group_id and that is passed through to the ADD button.
So if you switch your page filter to use implicit-join-style syntax then they should get passed through that way to the button.

Copy link
Contributor Author

@aydun aydun Jul 26, 2023

Choose a reason for hiding this comment

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

Hmm - I can't get it to work for that one. Maybe there's something else not quite right in the metadata? I've changed it as you suggest. How about we merge this then come back to the add button in another PR with the new pages?

@colemanw
Copy link
Member

Ok @aydun I'm happy to merge this but it looks like it'll need an upgrader for the navigation items.

@colemanw colemanw merged commit 967367d into civicrm:master Jul 26, 2023
3 checks passed
aydun added a commit to aydun/civicrm-core that referenced this pull request Jul 31, 2023
- fix unreleased regression relating to adding new price set fields and
  values
- add Upgrader
Switch html type from Select to EntityRef for Price Fields and Values
aydun added a commit to aydun/civicrm-core that referenced this pull request Jul 31, 2023
- fix unreleased regression relating to adding new price set fields and
  values
- add Upgrader
Switch html type from Select to EntityRef for Price Fields and Values
aydun added a commit to aydun/civicrm-core that referenced this pull request Jul 31, 2023
- fix unreleased regression relating to adding new price set fields and
  values
- add Upgrader
Switch html type from Select to EntityRef for Price Fields and Values
aydun added a commit to aydun/civicrm-core that referenced this pull request Jul 31, 2023
- fix unreleased regression relating to adding new price set fields and
  values
- add Upgrader
Switch html type from Select to EntityRef for Price Fields and Values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants