<% political_membership = role_appointment.historical_account.try(:political_membership) %>
  <%= content_tag_for :div, role_appointment, class: 'govuk-grid-column-one-quarter', role: "listitem" do %>
    <%# Content for "theresa-may' does not exist at present, temporary check to remove link %>
    <% if historic_appointment_path(role.historic_param, role_appointment.person) != "/government/history/past-prime-ministers/theresa-may" %> 
      <%= render "govuk_publishing_components/components/image_card", {
        href: historic_appointment_path(role.historic_param, role_appointment.person),
        image_src: role_appointment.person.image_url(:s216),
        image_loading: "lazy",
        heading_text: role_appointment.person.name,
        extra_links: previous_dates_in_office_prime(role, role_appointment.person, political_membership),
        extra_links_no_indent: true
      } %>
    <% else %>
      <%= render "govuk_publishing_components/components/image_card", {
        image_src: role_appointment.person.image_url(:s216),
        image_loading: "lazy",
        heading_text: role_appointment.person.name,
        extra_links: previous_dates_in_office_prime(role, role_appointment.person, political_membership),
        extra_links_no_indent: true
      } %>
    <% end %>
<% end %>

<% political_membership = role_appointment.historical_account.try(:political_membership) %>
  <%= content_tag_for :div, role_appointment, class: 'govuk-grid-column-one-quarter', role: "listitem" do %>
    <%# Content for "theresa-may' does not exist at present, temporary check to remove link %>
    <% if historic_appointment_path(role.historic_param, role_appointment.person) != "/government/history/past-prime-ministers/theresa-may" %>
      <%= render "govuk_publishing_components/components/image_card", {
        href: historic_appointment_path(role.historic_param, role_appointment.person),
        image_src: role_appointment.person.image_url(:s216),
        image_loading: "lazy",
        heading_text: role_appointment.person.name,
        extra_details: previous_dates_in_office_prime(role, role_appointment.person, political_membership),
        extra_details_no_indent: true
      } %>
    <% else %>
      <%= render "govuk_publishing_components/components/image_card", {
        image_src: role_appointment.person.image_url(:s216),
        image_loading: "lazy",
        heading_text: role_appointment.person.name,
        extra_details: previous_dates_in_office_prime(role, role_appointment.person, political_membership),
        extra_details_no_indent: true
      } %>
    <% end %>
<% end %>

Fix missing Prime Minister on historic PM page
Fix missing Prime Minister on historic PM page

An update to govuk_publishing_components changed the parameter names in
Release 27.0.0. We use the image cards to show rows of previous PMs
here.

The incorrect parameter names caused the image card to not render when
an href was not passed.

By renaming the params, the page renders correctly again.
