After update to the 7.x.1.4 version I have notice that Rendered entity formatter does not respect anymore "Show links" settings.

Steps to reproduce on vanilla Drupal installation:
1) install entityreference >= 1.3
2) create a test content type and add a entityreference field on it (a node refrence for me but I guess that the problem is reproducibile by referencing any entity type)
3) configure the display for the created entity reference field on "manage display" by set format: Rendered entity. In the formatter setting set view mode teaser and uncheck the "Show links" options.

4) create a test node (test content type) and fill the entityreference field.
5) when you view the created node the referenced entity links are shown without respect the formatter settings

Comments

willzyx created an issue. See original summary.

willzyx’s picture

Status: Active » Needs review
StatusFileSize
new764 bytes
mustanggb’s picture

IIRC [$item[$column]] has problems with PHP7.

You might have to do {$item[$column]} instead.

willzyx’s picture

IIRC [$item[$column]] has problems with PHP7.

You might have to do {$item[$column]} instead.

@MustangGB please can you provide some reference for this? I'm just curious.. :) if it is true there are some other points in the module that have this problem
I produced and tested the patch on php 7 whitout any issue

mustanggb’s picture

Nevermind, I mis-remembered, it's if it was something like $result->$item[$column] then you'd need to do $result->{$item[$column]}

Here is the reference: Changes to the handling of indirect variables, properties, and methods

Carry on.

willzyx’s picture

@MustangGB thanks for the reference!
Since there are not problems with the patch and it solves the issue reported can we mark it as RTBC?

megachriz’s picture

I can confirm that the patch fixes the issue in my case.

Here is the same fix, but with an automated test. The tests only patch should fail, it is meant to demonstrate the issue.

The last submitted patch, 7: entityreference-show-links-setting-2880772-7-tests-only.patch, failed testing.

megachriz’s picture

Small changes to the test:

  • Renamed the test from "EntityReferenceAdminTestCase" to "EntityReferenceFieldTestCase". There already was a test called "EntityReferenceAdminTestCase".
  • Text corrections in code comments.
  • Coding standards.

No functional changes were made.

willzyx’s picture

Status: Needs review » Reviewed & tested by the community

@MegaChriz great work! Looks good, to me it is RTBC.

erwangel’s picture

#2 worked for me also. Thank you

joseph.olstad’s picture

+1 for patch #9 , nice work adding the simpletest.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 9: entityreference-show-links-setting-2880772-9.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

willzyx’s picture

Status: Needs work » Reviewed & tested by the community

The failure was caused by views tests and was fixed here #2903006: Fix tests for 7.x-3.x. Back to RTBC

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 9: entityreference-show-links-setting-2880772-9.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

willzyx’s picture

Status: Needs work » Reviewed & tested by the community
joseph.olstad’s picture

erwangel’s picture

After the last "Entity reference" update, I had to (re)apply changes manually :( and have the "link" setup working again. Yes, please commit.

joseph.olstad’s picture

StatusFileSize
new5.74 KB

here's a straight reroll of #9 off of head

no difference than patch #9 other than being able to cleanly patch without fuzz

therefore maintain RTBC status

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 19: entityreference-show-links-setting-2880772-19.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

joseph.olstad’s picture

Status: Needs work » Reviewed & tested by the community

Maintainers, please set php7 as the default automated test.

Views 7.x-3.17 is a dependency of the tests and no longer supports php 5.3

joseph.olstad’s picture

Maintainers, please set php7 as the default automated test.

Views 7.x-3.17 is a dependency of the tests and no longer supports php 5.3

mustanggb’s picture

@joseph.olstad: Just an FYI, the breakage in views is only temporary, see #2903006: Fix tests for 7.x-3.x.

pcambra’s picture

Confirming the RTBC, links are no longer shown when opting out the show links option.

hkirsman’s picture

Confirming this works. Please release to dev.

gsquirrel’s picture

patch at #19 worked for me also

minoroffense’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new5.8 KB

Reroll against latest dev. If this passes I'll merge it in.

ciss’s picture

@minorOffense bump, you wanted to merge your reroll in #27. :)

  • minorOffense committed 8fea6a8 on 7.x-1.x
    Issue #2880772 by MegaChriz, willzyx, joseph.olstad, minorOffense: "Show...
minoroffense’s picture

Status: Needs review » Fixed
joseph.olstad’s picture

A release plan, all RTBC except one.

Status: Fixed » Closed (fixed)

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

joseph.olstad’s picture

joseph.olstad’s picture