Needs work
Project:
Bean (for Drupal 7)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Dec 2011 at 02:34 UTC
Updated:
15 Sep 2016 at 17:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
duellj commentedTitle shouldn't be required, updated patch to reflect that.
Comment #2
indytechcook commentedThanks!
http://drupal.org/commitlog/commit/22232/b31e746aaae09bd9f3e9efd4c2b3562...
Comment #4
aroq commentedI can't see this part from patch in the last versions of code:
/**
+ * Implements hook_field_extra_fields().
+ */
+function bean_field_extra_fields() {
+ $extra = array();
+
+ foreach (bean_get_types() as $type) {
+ $extra['bean'][$type->type] = array(
+ 'form' => array(
+ 'title' => array(
+ 'label' => t('Title'),
+ 'description' => t('Bean module element'),
+ 'weight' => -5,
+ ),
+ ),
+ );
+ }
+
+ return $extra;
+}
+
+/**
is it needed to make title module support working?
Comment #5
davemybes commentedYep, that missing bit of code is needed to get the Title field to appear and have Title module replace it.
Hmm, I get the following error when replacing the title:
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=295928&op=do StatusText: Service unavailable (with message) ResponseText: EntityMetadataWrapperException: Unknown data property title_field. in EntityStructureWrapper->getPropertyInfo() (line 339 of .../sites/all/modules/contrib/entity/includes/entity.wrapper.inc).The field appears to get replaced, but throws out a "The website encountered an unexpected error. Please try again later." error when you try to translate the block. I get the same error if I edit the new Title field and try to save it. You can delete the field and the site returns to normal.
*edit* Update title module to latest version fixes the problem. So using the following versions now:
Bean 7.x-1.0-rc5 (added missing code mentioned above)
Entity_translation 7.x-1.0-alpha2
Title 7.x-1.0-alpha3
Comment #6
james.williamsUnfortunately, things have changed since this patch, and I now find I get a 'Maximum function nesting level' (recursion) error when using the title field with the bean module. The attached patch solves this, as the defined label callback is no longer needed, and the default behaviour still seems to be correct. Explicitly defining the label callback results in the recursion error.
Comment #7
indytechcook commentedThanks James, that patch will not be applied as it removes all of the logic for the title out of the class. There is currently logic in there to change the label depending on where the bean is being displayed.
Comment #8
james.williamsAh, I had missed that the Bean class has a defined
defaultLabel()method that does this, sorry. The issue does indeed need work then... I hope to get this issue solved before too long, but of course anyone is welcome to beat me to it!Comment #9
Dishna commentedI am working on a multilingual site and have a issue with bean block not translating title. Is there a solution for this issue?
Help would be really appreciated.
Comment #10
timfernihough commentedIt turns out a customer of ours, for a site we have inherited, has used @james.williams patch from #6. Due to security updates, I have had to re-roll this patch for 7.x-1.11. I'm posting it here in case anyone else ever needs it but I don't expect this to be included. It is simply for those who might have relied on that patch for something and are now facing the prospect of security updates wiping this out.