as tedbow's comment @ Hide Entityform Type title(label) when it is attached to node and ER current is set , this can be achieved from EntityReference module.

Why is this specific to entityform?
because entityform is structurally different than normal nodes , Automatic Nodetitles , Automatic Entity Label and Title modules won't make form label hidden.

I came with simple code to achieve this, please make this code into patch.This was generated using winmerge on windows.

references:
https://drupal.org/comment/6783874#comment-6783874
http://stackoverflow.com/questions/517257/how-do-i-apply-a-diff-patch-on...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, entityreference-pass_entity_view.patch, failed testing.

nithinkolekar’s picture

FileSize
2.04 KB

sorry wrong patch was attached.

nithinkolekar’s picture

Issue summary: View changes
nithinkolekar’s picture

Issue summary: View changes
tedbow’s picture

@nithinkolekar, I like the idea. I also think it could be useful for other modules Entity Registration.

+++ C:/server/www/drup_dlist/sites/all/modules/entityreference/entityreference.module	Wed Apr 09 02:17:46 2014
@@ -1264,8 +1272,12 @@
+		if(!empty($settings['hide_title']))

I think there are whitespace issues with this patch.

You may try running your code through the Coder module first.

tedbow’s picture

Status: Needs work » Needs review

Also you have to set the status back to "Needs Work" for the automatic testing to be triggered.

Status: Needs review » Needs work

The last submitted patch, 2: entityreference-hide-entityform-title.patch, failed testing.

tedbow’s picture

@nithinkolekar

The patch failed because of

Detect invalid patch format
Ensure the patch only contains unix-style line endings.

This a common error on windows. You have to set up whichever text editor or IDE your are using to unix-style endings. It also helps if you set it up with other Drupal coding standards. A lot of the popular ones have extensions or add-ons that format files correctly for Drupal standards.

nithinkolekar’s picture

#5 done,#6 done and for #8 - patch generated on unix system

nithinkolekar’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 9: entityreference-hide-entityform-title-update1.patch, failed testing.

tedbow’s picture

Looks like you are still getting the error

Ensure the patch only contains unix-style line endings.

Maybe leftover from when you were editing files on Windows?

Also I am not sure if you have to but if I am running Coder I usually switch the setting to "minor (most)" from normal. It will alter you of the most problems.

nithinkolekar’s picture

Status: Needs work » Needs review
FileSize
2.11 KB

This time it should work, tested with scite editor which is showing unix line encodings ie LF. Coder doesn't seem to be testing unix-line encodings.

Status: Needs review » Needs work

The last submitted patch, 13: entityreference-hide-entityform-title-update2.patch, failed testing.

nithinkolekar’s picture

I quit, can't fight with system :(.

tedbow’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Needs work » Needs review

@nithinkolekar this time it was actually a different error

Detect a non-applicable patch
Ensure the patch applies to the tip of the chosen code-base.

See https://qa.drupal.org/pifr/test/767018

This means that our patch didn't apply to the correctly to the repo. Which version of the module were you working against? You should usually be writting patches against the dev version or in this case branch 7.x-1.x. But the issue was set to 7.x-1.1. I will change the issue and retest to see if it fixes it.

tedbow’s picture

Status: Needs review » Needs work

The last submitted patch, 13: entityreference-hide-entityform-title-update2.patch, failed testing.

nithinkolekar’s picture

Patch was written to 7.x-1.1 (timestamp 1384973110).

On visiting test result page I got this

[13:43:06] Command [git apply --check -p1 /var/lib/drupaltestbot/sites/default/files/review/entityreference-hide-entityform-title-update2.patch 2>&1] failed
  Duration 0 seconds
  Directory [/var/lib/drupaltestbot/sites/default/files/checkout/sites/default/modules/entityreference]
  Status [1]
 Output: [error: tmp/patches/er/entityreference-patched.module: No such file or directory].

I don't get why it is searching in that directory. As you can see in patch, it was created using diff on entityreference-ori.module entityreference-patched.module files.

All other other patches on D.O are having diff on directory like a/original_file and b/modified_file. Is this causing the problem or filename entityreference-patched.module is the problem.

odisei’s picture

Is there any progress on this issue?
Thanks

Nicolas Bouteille’s picture

Hi there,

I just applied the patch manually, it works perfect. Does the job and no errors at all for now.
I noticed a few things that could explain why the patch won't pass.
It looks like indentation is not good on this line
+ $element['hide_title'] = array(
and also for this block of code

+    if (!empty($settings['hide_title']))
+      $hide_title = TRUE;
+    else
+      $hide_title = FALSE;

but more importantly, I believe Drupal's best practice states that conditional statements should always have braquets '{}' even if one-line-only.
I have never created a patch yet so maybe this won't solve it but I would personally try that.
Good luck! Hope this gets committed in next version but just in case I'm gonna apply a display: none as a backup plan...

jgullstr’s picture

Status: Needs work » Needs review
FileSize
1.89 KB

Re-roll for dev.

jgullstr’s picture

Status: Needs review » Reviewed & tested by the community

RTBC. The rationale behind the patch is straight-forward: Add a flag that controls the value of the $page parameter when calling entity_view.

$page: (optional) If set will control if the entity is rendered: if TRUE the entity will be rendered without its title, so that it can be embeded in another context. If FALSE the entity will be displayed with its title in a mode suitable for lists. If unset, the page mode will be enabled if the current path is the URI of the entity, as returned by entity_uri(). This parameter is only supported for entities which controller is a EntityAPIControllerInterface.

An addition that could be useful, is to show the setting iff the current entity controller implements EntityAPIControllerInterface.

//Josef

nithinkolekar’s picture

@jgullstr , just for info ...

When we say "Rendered entity" and configure as "Full Content", it should respect the "Manage Display" setting of rendered entity not just entityform but any entity in general , am I right?.

The reason I am asking is that in "Manage Display" of Entityform "Full Content" some fields are hidden but it is only working when form is viewed in entityform's direct submission link not when it is rendered inside node.

Apologies and rephrasing above statement for future readers...
The reason I am asking is that in "Manage Display" of Entityform "Full Content" some fields are made hidden but it not working both when form is viewed in entityform's direct submission link and also when it is rendered inside node. See #26 for more info.

jgullstr’s picture

Title: Hide title/label when entityform is referenced and displayed as rendered entity » Option to hide title on rendered entities implementing EntityAPIControllerInterface
Category: Bug report » Feature request
Status: Reviewed & tested by the community » Needs review
FileSize
2.05 KB

Added EntityAPIControllerInterface implementation guard, as settings are confusing for e.g. nodes when "Hide title" has no effect.

@nithinkolekar: You are correct that entities should be displayed as configured under their respective "Manage display" section. I don't quite follow what you cannot get working, can you provide more info / screenshots?

//Josef

nithinkolekar’s picture

@jgullstr never mind, before writing that tiny patch , I was just wanted to hide entityform's label by using title module. But entityform is a special case where it is not having title field but always shows its human-readable name just like block.

As for the "manage display" settings of entityform, it is not displaying as it was configured when attached to node and also when viewed using submission link.See screenshots

jgullstr’s picture

Ah, I see. The display settings are how to display the form submissions, not the form itself (Similar to how you configure node display under content types). To hide the form title without this patch, I suppose the quickest way would be to override its template or theme function.

//Josef

ndf’s picture

I tried this patch with a taxonomy entity-reference and with the title module enabled. It didn't hide the title tough (talking about the title in the template file).
To me a more logical place would be the manage display tab, because thats where you configure the viewmodes.

dieuwe’s picture

Status: Needs review » Reviewed & tested by the community

This feature is something I've been looking for on a few separate occasions, I'm glad to finally have found it.

Patch from #25 works great with a custom entity being referenced. Not using the title module.

Would love to see this in the next release.

rodrigoaguilera’s picture

I tested #25 with entityforms and works as expected

nithinkolekar’s picture

@nielsdefeyter as mentioned by jgullstr at #27 manage display settings applied when entities are being viewed after submission also called as viewmode. That patch is for entity when it is being created AKA form submission mode. This usually helpful for entities like Entityform , Entity Registration or may be some more in future.

senzaesclusiva’s picture

Successfully applied the patch but I can't see option to hide title in a rendered entity field.
what am I doing wrong?

nithinkolekar’s picture

I am not sure whether implementing using EntityAPIControllerInterface Interface should also work when "content : rendered node" is added as field in view?.
When rendered node is added to views field no options are available like "hide title" or "show links". Is this normal behavior ?

nithinkolekar’s picture

Status: Reviewed & tested by the community » Needs work

same as #32

jgullstr’s picture

What kind of entities are you rendering? This patch only controls the $page flag in entity_view (See #23). The setting will only be available when referenced entities implement EntityAPIControllerInterface, entityforms being the prime use case. For other entities - nodes, taxonomy terms, users and the like - you will have to find an alternative solution.

nithinkolekar’s picture

Status: Needs work » Reviewed & tested by the community

@jgullstr

entity is of type node and I didn't followed #25 :(

Added EntityAPIControllerInterface implementation guard, as settings are confusing for e.g. nodes when "Hide title" has no effect.

Will see for other possible solution.

Setting back to RTBC because it is specific to EntityAPIControllerInterface

minorOffense’s picture

Status: Reviewed & tested by the community » Needs work

Patch fails against latest dev.

minorOffense’s picture

I've re-rolled the patch. However it needs test cases before I can commit it to dev.

minorOffense’s picture

Re-roll against dev.

  • minorOffense committed f0f8e86 on 7.x-1.x
    Issue #2236527 by nithinkolekar, jgullstr, minorOffense, senzaesclusiva...
minorOffense’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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