Problem/Motivation

I created my profile_type (multiple) with a Label and even Display label, but the local action and the add form page title say "Add Profile" instead of "Add [my Label / Display label]".
Is it possible to change it programmaticaly without hacking Profile module itself?
Thank you

CommentFileSizeAuthor
#3 3360825-3.patch3.97 KBdww
#2 3360825-2.patch2.62 KBdww

Issue fork profile-3360825

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kopeboy created an issue. See original summary.

dww’s picture

Status: Active » Needs work
StatusFileSize
new2.62 KB

Yup, I needed exactly the same. Thanks for opening the issue about it.

Here's the start of a solution. This fixes the 'Add profile' local action. Still "needs work" to also fix the page title of the add form itself.

dww’s picture

Version: 4.0.x-1.x-dev » 8.x-1.x-dev
StatusFileSize
new3.97 KB

This fixes the title of the add form, too. I reproduced the test fails locally, so that's coming next. 😅 Fixing version so we can open an MR, instead of patches.

dww’s picture

Status: Needs work » Needs review

354f8f43 should fix the failing tests, but it might be cheating. 😅 Shows this is a potentially disruptive change. Not sure if we need to make this behavior a setting that folks have to opt into.

dww’s picture

Still need this. 😅 There were merge conflicts, so I rebased the MR. There's a phpcs and phpstan (max PHP version) failure in profile.module that's untouched by this MR. Not sure what's going on with that, but seems out of scope to fix it here.

phpcs

--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 71 | ERROR | [x] Parameter $items has null default value, but is not marked as
    |       |     nullable.
    |       |     (SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue.NullabilityTypeMissing)

phpstan (max PHP version)

 ------ ----------------------------------------------------------------------- 
  Line   profile.module                                                         
 ------ ----------------------------------------------------------------------- 
  71     Deprecated in PHP 8.4: Parameter #4 $items                             
         (Drupal\Core\Field\FieldItemListInterface) is implicitly nullable via  
         default value null.                                                    
 ------ ----------------------------------------------------------------------- 
 [ERROR] Found 1 error                                                          

Trivial fix, but seems out of scope. Not sure why this pipeline is complaining about it, since I didn't touch that and it's identical in the 8.x-1.x branch (which seems to be passing).

jsacksick made their first commit to this issue’s fork.

  • jsacksick committed 83b291b9 on 8.x-1.x authored by dww
    Issue #3360825 by dww: Use profile type label instead of "profile" in...
jsacksick’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.