Problem/Motivation

There is a link "Add new change record" at the top of the CR overview page. For some projects, the link ends with a token [field_project] instead of being replaced with a number, which seems to be the correct behavior. As a result, the project field on the "Create new change record" form is not prepopulated for these projects.

Some affected projects:

Some unaffected projects:

Steps to reproduce

For an affected project:

  1. Click on View change records in the sidebar of the project page to get to the CR overview page.
  2. Right below the tabs there is a link "Add new change record"

Actual result

For some projects, the link ends with a token [field_project]. As a result, the project field on the "Create new change record" form is not prepopulated for these projects.

Expected result

The the link ends with an integer. The project field on the "Create new change record" form is prepopulated with the correct project name.

Proposed resolution

Unclear, as the exact cause is unclear.

Remaining tasks

Debug. Propose a fix. Review. Commit.

User interface changes

The link works as expected.

API changes

tbd

Data model changes

tbd

Comments

feyp created an issue. See original summary.

feyp’s picture

Issue summary: View changes
fjgarlin’s picture

Investigation:
- The view "change_records" on D7 is using the token "[field_project]" in the header to generate the link.

Sometimes it works, sometimes it doesn't. There doesn't seem to be any custom code around it.

fjgarlin’s picture

Assigned: Unassigned » drumm

This happens when the view has no results. Same project:
- 1 result, link is good: https://fjgarlin-drupal.dev.devdrupal.org/list-changes/drupalorg_crosssi...
- 0 results, link is wrong: https://fjgarlin-drupal.dev.devdrupal.org/list-changes/drupalorg_crosssi...

The fix is to change the header area from:
<a href="/node/add/changenotice?field_project=[field_project]">Add new change record</a>

to:
<a href="/node/add/changenotice?field_project=!1">Add new change record</a>

This can be done in the different displays where needed and then export the feature. @drumm can do that when he's back from holiday.

fjgarlin’s picture

Status: Active » Needs review

  • drumm committed 3c22e24e on 7.x-3.x
    fix: #3593650 Token in "Add new chage record" link sometimes not...
drumm’s picture

Status: Needs review » Fixed

Thanks, the fix for this will be in the next deployment, which might not be for a few days.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.