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

dev/core#4213 Make contribution_page.frontend_title required #26259

Merged

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

dev/core#4213 Make frontend_title required

Before

frontend_title field optional - leading to inconsistency

After

frontend_title field now required - also I added a unique name field

Technical Details

#25993 was a bit too tricky so this tackles just one of the 3 entities

Comments

@civibot
Copy link

civibot bot commented May 18, 2023

No issue was found matching the number given in the pull request title. Please check the issue number.

@civibot
Copy link

civibot bot commented May 18, 2023

(Standard links)

@larssandergreen
Copy link
Contributor

If we're doing this, maybe we should rename Title (the non-public one), to Name or Page Name, so it's more clear, because it isn't really the title of the page anymore, since it doesn't appear on the page. That's maybe not ideal with the new name field, but I think it would be more clear to users.

@eileenmcnaughton
Copy link
Contributor Author

@larssandergreen good idea - note the name field won't be exposed to users - it's just to have a machine name like other entities

@larssandergreen
Copy link
Contributor

@eileenmcnaughton Yes, just confusing for us, but that's bearable.

@eileenmcnaughton eileenmcnaughton force-pushed the frontend_contribution_page branch 15 times, most recently from a5d1424 to b322a8a Compare May 23, 2023 23:20
@eileenmcnaughton eileenmcnaughton force-pushed the frontend_contribution_page branch 4 times, most recently from b075d62 to 75c5b6b Compare May 30, 2023 02:21
@eileenmcnaughton
Copy link
Contributor Author

@colemanw @seamuslee001 down to 1 fail

  • not quite sure if there is a way to rewrite that bit with the exosting localize function
Cannot execute UPDATE `civicrm_contribution_page`
SET `frontend_title_en_US` = `title_en_US`
  WHERE `frontend_title_en_US` IS NULL OR `frontend_title_en_US` = '';, UPDATE `civicrm_contribution_page`
SET `frontend_title_af_ZA` = `title_af_ZA`
  WHERE `frontend_title_af_ZA` IS NULL OR `frontend_title_af_ZA` = '';, UPDATE `civicrm_contribution_page`
SET `frontend_title_bg_BG` = `title_bg_BG`
  WHERE `frontend_title_bg_BG` IS NULL OR `frontend_title_bg_BG` = '': DB Error: syntax error

@colemanw
Copy link
Member

colemanw commented Jun 1, 2023

You could do a loop like this:

{if $multilingual}
{foreach from=$locales item=locale}
UPDATE civicrm_option_value SET name = 'Open' where option_group_id = @csgId AND label_{$locale} = 'Ongoing';
UPDATE civicrm_option_value SET name = 'Closed' where option_group_id = @csgId AND label_{$locale} = 'Resolved';
{/foreach}
{else}
UPDATE civicrm_option_value SET name = 'Open' where option_group_id = @csgId AND label = 'Ongoing';
UPDATE civicrm_option_value SET name = 'Closed' where option_group_id = @csgId AND label = 'Resolved';
{/if}

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 @colemanw it passed!!!!

@@ -14,3 +14,19 @@ VALUES
( {$domainID}, 'https://civicrm.org/help?src=iam', '{ts escape="sql" skip="true"}Get Help{/ts}', 'Get Help', NULL, 'AND', @adminHelplastID, '1', NULL, 2 );

UPDATE IGNORE `civicrm_navigation` SET `name` = 'Register Your Site', `label` = '{ts escape="sql" skip="true"}Register Your Site{/ts}' WHERE `name` = 'Register your site';

-- Ensure new name field is not null/unique. Setting to ID is a bit lazy - but sql localisation is painful.
Copy link
Member

Choose a reason for hiding this comment

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

@eileenmcnaughton - is this an outdated comment? You seem to have pushed through the pain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no - that update is still just setting name to id

@eileenmcnaughton eileenmcnaughton changed the title dev/core#4213 Make frontend_title required dev/core#4213 Make contribution_page.frontend_title required Jun 2, 2023
@colemanw colemanw merged commit 1c579d0 into civicrm:master Jun 2, 2023
@colemanw colemanw deleted the frontend_contribution_page branch June 2, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants