I am currently developing custom breadcrumbs integration with module features so that custom breadcrumbs can easily be exported and reused among features and drupal instances.

Is anyone interested in the public release of the code or integrate it directly in module core?



#92 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-92.patch42.26 KBrealityloop
#90 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-90.patch64.88 KBfengtan
#90 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-90.png153.28 KBfengtan
#89 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-89.patch73.44 KBfengtan
#84 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-84.patch73.51 KBvinmassaro
#82 custom_breadcrumbs_features_integration_7_x_2_x_dev.patch75.29 KBkemsnake
#79 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-79.patch73.52 KBmrfelton
#77 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-77.patch36.73 KBmrfelton
#66 features_integration_d7-579690-66.patch13.47 KBrealityloop
#64 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-64.patch73.65 KBbitkid
#63 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-63.patch36.73 KBbitkid
#59 579690-features.patch68.82 KBxtfer
#58 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-58.patch74.51 KBlucor
#56 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-56.patch73.97 KBlucor
#55 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-55.patch73.9 KBlucor
#54 custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-50.patch73.95 KBJan van Diepen
#53 custom_breadcrumbs_features_integration_6_x_2_0_rc1-579690-43.patch70.82 KBTarch
#49 custom_breadcrumbs_features_integration_6_x_2_0_dev-579690-49.patch75.64 KBJan van Diepen
#43 custom_breadcrumbs_features_integration_6_x_2_0_rc1-579690-43.patch70.82 KBJan van Diepen
#42 custom_breadcrumbs_features_export-579690-42.patch16.07 KBjamiecuthill
#39 579690_7-1_custom_breadcrumbs_features_export-1.patch16.08 KBtheapi
#38 579690_7-1_custom_breadcrumbs_features_export.patch16.08 KBtheapi
#18 579690_cb_features_integration.patch1.26 KBMGN
Members fund testing for the Drupal project. Drupal Association Learn more


MGN’s picture

I am interested in learning more about this. What's required to do this? Can you provide some details?

hernani’s picture


Basically features allows you to export your module definitions to code, so that they can be imported in other drupal installations, compared, synchronized or updated.

Basically what is needed to achieve this is to change the way how custom breadcrumbs access data, so that instead of checking only in the database table it could also check in modules hook.

I think that custom breadcrumbs could achieve this if we stop to use the bid identifier in custom breadcrumbs table, and try to find other primary key for custom breadcrumbs that can be a string no auto-incremented. A key like node _ language, or views_path seems good candidates to this.

Right now i can not do this without this change.

I can provide some of the code developed, so we can achieve this feature and allow that custom_breadcrumbs can be exported along with spaces, contexts, pages, views, etc..

redben’s picture

+1 for Features integration !

ademarco’s picture


mrfelton’s picture

yes please!

techninja’s picture

+1 - An absolute must for anyone using breadcrumbs and features

detot’s picture


redben’s picture

@hernani have you been able to make this feature work ?

hernani’s picture

I was unable to finish this task, mainly because features needs that each exportable object have an unique identifier that do not depends on auto increment keys, like custom breadcrumbs is currently using.

If it would be possible to identify custom breadcrumbs with other identifier (like a unique machine name), would be really easy to integrate with features..!

Are module maintainers available to change this behavior?


mrfelton’s picture

Alternatively, I think it's possible to use exportables to generate the unique keys for you... or something like that. But, clearly changing custom_breadcrumbs would be preferable.

MGN’s picture

If it would be possible to identify custom breadcrumbs with other identifier (like a unique machine name)

So instead of storing bid in an autoincrement field, if we stored a unique string like

'$_SERVER["SERVER_NAME"]' . '-' . $bid;

then it would integrate with Features? Is there anything else that would need to be done?

Sorry, again, I haven't used Features so it would be helpful for someone to fill in all the necessary details.

redben’s picture

Issue tags: -CTools exportables

Why not use "BREADCRUMB TYPE" and "NAME" as they appear on "admin/build/custom_breadcrumbs/list"
edit: For the name, it would need to be translated to machine name. Breadcrumb names are already machine names.

rickvug’s picture

Issue tags: +CTools exportables

How adopting cTools' model for exportables? If I'm not mistaken, Features will automatically notice that Custom Breadcrumbs uses this common format and will provide the necessary integration. In another scenario, if Custom Breadcrumbs used variables for storage then Strongarm (2.x branch) would provide the cTools exportable and Features integration on behalf of the module.

mrfelton’s picture

I'd rather see Custom Breadcrumbs implement cTools itself that rely on strongarm to export all of it's configurations via variables. Strongarm becomes particularity problematic to use effectively wit large websites with many modules installed due to the sheer number of variables.

IMO variables should be used to store simple settings and these can be exported with Strongarm. Modules that have more detailed configurations (such as custom breadcrumbs) should provide their own way to export via Features, possibly using cTools.

MGN’s picture

Issue tags: +CTools exportables

@rickvug, thanks for tagging this issue and others like it. I am learning a lot by reading what others have done, including Stella's blog entry that describes the basic idea. I think I am starting to see the (ctools) light...It opens up some interesting possibilities in addition to the Features integration.

rickvug’s picture

@MGN You're welcome. I don't mind doing a little bit of organization and hand waving from time to time. The prospect of being able to easily push config to code has been a long held dream for many. IMO the pathway forward has never been as clear. Time to rally behind a common API.

MGN’s picture

After making the following change to the custom_breadcrumb table (adding a unique key combining bid and node type), I was able to build a functional ctools export form. I've also developed a working import form within custom breadcrumbs that takes the code from the export form and adds a new breadcrumb into the database.

There are many possibilities here, but I think the only change you might need to proceed with the features integration is the unique key, so I've attached a patch for the custom breadcrumbs install file. With this, features now recognizes custom breadcrumbs (it shows in the select at admin/build/features/create), though the exportable objects obviously aren't rendered since the feature hooks have yet to be implemented.

It seems the next step would be to implement the key features hooks, but I haven't looked too deeply into that yet. Perhaps someone else who knows these hooks better than I can develop the implementation? Is this done with the features module (i.e. features.custom_breadcrumbs.inc), or within custom breadcrumbs directly?

On another note, does it make sense to add export/import operations (and forms) within custom breadcrumbs for exporting without features? We could even goes as far as providing default custom breadcrumb objects that can be overridden (as with views, etc.). Would this be a signifcant advantage , or is database storage sufficient?

What are your thoughts and suggestions for moving forward?

MGN’s picture

Status: Active » Needs review
mani.atico’s picture

Status: Needs review » Needs work

From my point of view, using ‘node_type’ (or other identifiers as ‘tid’) and bid fields could be inconvenient when exporting or modifying the feature: you’ll get a bunch of numbers and you’ll have to know to which “object” this numbers refers to – if you have two breadcrumbs settings for a single node type you’ll have to know the bid number of the cb setting you want to export, and it could get worst when the “object” identifier is another number (tids for example).

This could be ‘fixed’ in the administrative interface by implementing some features’ hooks, but this solution would be no good if you’re using drush to build you’re features.

On the other hand, as bid is just an auto incremental field it should be excluded from the exported object and should not be written into the database of the site where the feature is being installed (check the ‘no export’ setting on the Ctool’s advanced help documentation). I think (I’m not completely sure) that if this field is taken out of the exported object but is used as part of it’s identifier, that relation of the object in the database and the one in code would be lost.

I think that a machine-name field should be added to the schema. It could be the 'name' field – set as unique and restricted to machine-readable characters - or another field which generates it’s value by replacing invalid characters of the ‘(friendly) name’ field could be added. This would be the machine-readable unique identifier needed to integrate with features through the CTools’ API.

The second part of the proposal is a bit shaky since I haven't check the code throughfully. I don't know if the proposal I'm about to make might have negative impacts on code, performace, ease of use, extensibility, ease of imlementation, etc. Or if it will mean re-coding the whole module. I apologize if this has been discussed anywhere else, it’s just a start point which might be useful for someone who is more familiar with the code:

I've noticed that cb and each submodule declares the same db schema except for a single field whcih holds the id or information of the "object" that triggers the custom breadcrumb: node_type, view_path, panel_id, etc. How about merging all schemas into a single table by removing the field which holds the id and adding two new fields: type and id? type would hold the name of the "object" to which the custom breadcrumb should be applied (“node_type”, “view_path”, “panel_id”, etc) and id would hold the identifier or the relevant data needed to determine when to trigger the custom breadcrumb (the name of the node type, the path of the view, the id of the panel, etc). This way features integration could be provided from a single place without having to re-declare the CTool's schema specifics on each submodule and exportable objects would be automatically generated for modules which declare cb settings through the API.

lelizondo’s picture


muhleder’s picture


ygerasimov’s picture

I would be very interested in developing integration of custom breadcrumbs with features. Can I help somehow?

davidburns’s picture


mikebell_’s picture


rjivan’s picture

Any update on this?

hernani’s picture

At the time i was not able to finish this task, and I ended up not using it on the feature i was developing.

I see that are still interested people on this capability, i will try to pay some attention to MGM's changes posted in #18 and understand if it is now possible to implement it.

iStryker’s picture

Assigned: Unassigned » iStryker
Status: Needs work » Active
Issue tags: -CTools exportables

I'll take this over

iStryker’s picture

Update: I have integrated Ctools export with Custom Breadcrumbs and it works, however it only works for node_type, and none of the other submodules. I'm having troubles as the user interface is a little different, and each module has a separate table. I am trying to create a user interface that will be able to do everything. I am currently having trouble with FormAPI and AJAX. I posted an issue on Ctools. http://drupal.org/node/958572. Any help would be appreciated. If not, then I'll keep struggling

ygerasimov’s picture

I would like to give support on developing 'exportables' for this module. I have found another approach using features hooks http://treehouseagency.com/blog/thomas-wysocki/2010/10/28/making-your-mo...

@iStryker: Is there any repo where I can see development of this feature and get involved?

Jackinloadup’s picture


wizonesolutions’s picture

Interested in this as well since the crumbs already have a "name" and since paths are likely to be the same across sites.

alberto56’s picture

Subscribing. Thanks for your work.

soulfroys’s picture

It would be awesome *feature*!

alberto56’s picture

Meanwhile, here is what I do: in the install file of the feature (create one if one does not already exist), add the following or integrate into the existing install hook implementation:

function MYFEATURENAME_install() { /* change MYFEATURENAME for your actual feature name */
  if (function_exists('_custom_breadcrumbs_save_breadcrumb')) {
    $obj->paths = 'projects'; /* projects is an example here, put whatever you want */
    $obj->titles = 'Projects';
    $obj->node_type = 'project';
    $obj->name = 'Custom breadcrumb for projects';
    _custom_breadcrumbs_save_breadcrumb('custom_breadcrumbs', 'node', $obj);

If your feature is already installed and you are adding this functionality, you will have to add an update hook implementation and then run a database update on your target site, because the install function will never be called (of course, we're not really touching the database here. Rather, we're hijacking hook_update_N(), which is meant for database updates, and using it for something else):

function MYFEATURENAME_update_6000() {
  if (function_exists('_custom_breadcrumbs_save_breadcrumb')) {
    $obj->paths = 'projects';
    $obj->titles = 'Projects';
    $obj->node_type = 'project';
    $obj->name = 'Custom breadcrumb for projects';
    _custom_breadcrumbs_save_breadcrumb('custom_breadcrumbs', 'node', $obj);
  return array();

This is not ideal, but it works for me in some situations. Cheers,


rickvug’s picture

A suggestion around machine names - what about simply using the content type and enforcing that there can only be once custom breadcrumb rule per content type? At the moment (using D7-1.x) I can create multiple rules per content type, which is a bit pointless seeing as how I'd only want the one. Most features are built around a content type so this mapping should be natural. If this isn't workable then the best thing to do would be to change bid to machine_name, with the upgrade path creating machine_name from bid+node_type. Drupal 7 FAPI supports machine name as a special field so the fancy auto generation from the title comes for free.

theapi’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
16.08 KB

I see that new features are not being added to 7.x-1.x, but here's a patch to add Features to 7.x-1.x incase somebody wants it.

theapi’s picture

Actually use this patch not my previous one.

rickvug’s picture

Title: Features Integration » Exportability (machine names and Features Integration
Status: Active » Needs review

I haven't had the time to do a full review of the changes in #39. One area that still needs work and discussion is the upgrade path. A few issues:

  • The function custom_breadcrumbs_update_6102() is named incorrectly. Updates for version 1.x for Drupal 7 should be custom_breadcrumbs_update_71XX().
  • If all usage of $bid is to be removed then the bid column should go as well.
  • Is moving the values of bid into name the best upgrade path? It isn't portable. Other options would be article, article+bid or a random hash.

Overall I really like the direction of the patch. Providing machine names and using ctools for exportability is certainly the way to go. Some feedback from the Custom Breadcrumbs maintainer would be valuable at this point.

rickvug’s picture

Title: Exportability (machine names and Features Integration » Features Integration (machine names, import and export via ctools)
jamiecuthill’s picture

The _custom_breadcrumbs_load_for_type function should load conditions, not names.

Jan van Diepen’s picture

Version: 7.x-1.x-dev » 6.x-2.0-rc1
Assigned: iStryker » Unassigned
70.82 KB

I needed features integration for a project. The project is still on drupal 6, so I created a patch for Custom Breadcrumbs and all of its sub-modules on 6.x-2.0-rc1. I had to make some changes to the database schemas, so be sure to run update.php after patching. To use it you need to have the features module installed. It uses the standard features hooks.

Copy the patch to the custom_breadcrumbs directory and run the following command:
patch -c -p 1 < custom_breadcrumbs_features_integration_6_x_2_0_rc1-579690-43.patch

Now run the database update.php script.
Either from your browser (you need to be logged in as admin).

or from the command line using drush from your drupal root:
drush updb

If you have any custom breadcrumbs defined, navigate to Site building >> Features on your website and select Create feature.
On the form that appears in the Edit component select list a number of Custom Breadcrumbs components will show up depending on the type of the custom breadcrumbs you have defined on your system.

brunorios1’s picture


Cyberwolf’s picture


jason.fisher’s picture

Patch almost applies to dev. All except taxonomy:

patching file custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.module
Hunk #1 succeeded at 44 (offset -4 lines).
Hunk #2 succeeded at 52 (offset -4 lines).
Hunk #3 succeeded at 103 (offset -4 lines).
Hunk #4 FAILED at 558.
1 out of 4 hunks FAILED -- saving rejects to file custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.module.rej
goldlilys’s picture

Subscribing. For d7 also if possible.

Jan van Diepen’s picture

Thanks for the feedback jason.fisher!

Hope you did not miss that the patch is for 6.x-2.0-rc1.
Let me find some time to post a new patch for dev one of these days.

Jan van Diepen’s picture

Version: 6.x-2.0-rc1 » 6.x-2.x-dev
75.64 KB

Here's the same patch on dev.

patch -c -p 1 < custom_breadcrumbs_features_integration_6_x_2_0_dev-579690-49.patch

Remember it will works on the current (29 November 2011) dev release.
Any changes made to dev might invalidate it.

Snugug’s picture

Does anyone have a version of this patch for D7?

wizonesolutions’s picture

Hey @goldlilys, you can use the Follow button in the top-right now instead of typing a subscribe comment. Enjoy :)

Tarch’s picture

I have encountered a little problem with the patch for 6.x-2.0-rc1.

The problem is in here

function custom_breadcrumbs_panels_config_features_export_options() {
  $options = array();

  $query = " SELECT machine_name, node_type FROM {custom_breadcrumbs_panels} ";
  $params = array();
  $result = db_query($query, $params);
  while ($row = db_fetch_array($result)) {
    $options[$row['machine_name']] = 'Panel ID: '. $row['panel_id'];
  return $options;

The query for the panels should be:

  $query = " SELECT machine_name, panel_id FROM {custom_breadcrumbs_panels} ";

Thank you,

Tarch’s picture

attached you find the patch with the correction of the bug I reported plus the replacement of a couple of dashes that should be underscores.

  $saved = _custom_breadcrumbs-panels_config_set_data($item);


      $code[] = '  $custom_breadcrumbs-panels_configs[] = '. features_var_export($item, '  ') .';';

in both cases the dash after 'breadcrumbs' is meant as a subtraction for PHP.


Jan van Diepen’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
73.95 KB

Hi Snugug,

I created a first go at a patch for the 7.x-2.x development branch.
Let's all hope it makes it into the next release.

To apply the patch, follow the instructions on http://drupal.org/node/1054616

Hope you can give it some testing. Do not forget to run update.php.

This upgrade is sponsored by Unicef Uganda for the Devtrac project.

lucor’s picture

Updated the patch in #54 to handle feature import in a clean drupal installation.

lucor’s picture

Fixed machine_name generation on creation

bitkid’s picture

I can't get this patch to apply.

The problem seems to be, that the patch wants to work on line 8 of the .info file, but the correct line is 7. (line 159 of the patch).

Is there something that I should have done before applying this patch?

lucor’s picture

It seems corrupted. I've uploaded a new version. Let me know if now works.

xtfer’s picture

68.82 KB

Updated the patch in #49 by Jan van Diepen, for 6.x-2.x-dev.

- Works against Dev current as of 4.12.11 (patched against commit #f6ee1aa)
- Fixed an issue with the length of machine name unique keys (reduced to 255 chars for InnoDb compatibility)
- Removed some extraneous .eclipse junk which had crept in

Leaving this at 7.x, however note this is a 6.x patch.

bitkid’s picture

It is much better now. The patch applies without errors now. Thanks.

I couldn't get the import working when I tested it, but I will do some more testing of it today or tomorrow.

bitkid’s picture

When trying to add my feature to another system, the import of the feature fails.

In the _set_data methods of the submodules (like panels and paths) the insert is only run if the delete actually deletes something. Therefore I never get anything into the database. If I remove the check on $result, the data is stored perfectly. Is there a good reason for having that check?

lucor’s picture

I've the same behaviour reported in #61. Modified the code as reported below and works fine.

function _custom_breadcrumbs_config_set_data($item) {
  $values = array_values($item);
    ->condition('machine_name', $values[0]['machine_name'])
  $result = db_insert('custom_breadcrumb')
      'name' => $values[0]['name'],
      'machine_name' => $values[0]['machine_name'],
      'titles' => $values[0]['titles'],
      'paths' => $values[0]['paths'],
      'visibility_php' => $values[0]['visibility_php'],
      'language' => $values[0]['language'],
      'node_type' => $values[0]['node_type']))
  return $result;
bitkid’s picture

Here is a patch Fixing the problem mentioned in 61 and 62. Fixed in all submodules.

NOTE: This patch was created against the git version (commit 0b50c14), not the tar.gz version and it will fail to patch the .info files on that version.

bitkid’s picture

oh no... I did wrong... shame on me...

Here is the correct patch. Sorry about that.

SuleymanK’s picture

Great work.

unfortunately custom_breadcrumbs for views and paths are not exported correctly. The array keys in features.inc are negative integer values like -1311865374. After wrapped this array keys with '-1311865374' it reverted fine.

realityloop’s picture

#39 used update_sql which no longer exists in D7

This is a git patch against 7.x-1.0-alpha1

mikemadison’s picture

The good news: As far as I can tell, the patch in #66 applies cleanly, and Features now shows me a custom breadcrumbs export option. Hooray.

The bad news: The custom breadcrumbs module itself now won't load and the landing page gives me a WSOD. Booo!

In digging through my logs a bit, nothing is tripping in the Drupal side of the house. PHP error logs show that the custom breadcrumbs module is now throwing a "drupal undefined function ctools_export_crud_load_all" error in custom_breadcrumbs.module at line 182.

I did a bit of digging and this is an older issue, but seems relevant: http://drupal.org/node/1104536

If i include the following in my code, the error goes away and the module page itself will load now (and I can still export the breadcrumbs). Sounds like progress!

function _custom_breadcrumbs_load_all_breadcrumbs($refresh = FALSE) {
  return ctools_export_crud_load_all('custom_breadcrumb', $refresh);

From Features, when I start exporting the custom breadcrumb, it automatically dumps a ton of Strongarm variables in that I don't understand. Is anyone else seeing this behavior? (e.g. node_options, node_submitted, comment_preview, etc.)

As far as I can tell, the custom breadcrumbs apply smoothly when you import the feature.

Nice work all! As long as the strongarm stuff doesn't concern anyone, I would just suggest re-rolling the patch in #66 to include the ctools_include above to ensure that others don't run into the error that I did.

mikemadison’s picture

Actually, it looks like the ctools_include should be included in all functions where custom breadcrumbs tries to return the ctools_export family of functions.

colan’s picture

Category: task » feature
Status: Needs review » Needs work

As per:

I would just suggest re-rolling the patch in #66 to include the ctools_include above to ensure that others don't run into the error that I did.

vinmassaro’s picture

Throwing in my 2 cents so we can hopefully get some life in this issue. The patch in #66 applies cleanly for me to 7.x-1.0-alpha1 and exports breadcrumbs into my feature correctly. I did not encounter any of the issues experience by lalweil in #67 - no white screens with CTools 7.x-1.0 and no Strongarm variables being added.

realityloop’s picture

Status: Needs work » Needs review

marking this as needs review again in light of vinmassaro's comments

realityloop’s picture

lalweil: can I suggest you turn on error reporting and let us know what actually caused your WSOD, also could you let us know what version of PHP you are using please?

mikemadison’s picture

I'm running PHP 5.3.3.

The error was pretty much what I paraphrased above:
Fatal error: Call to undefined function ctools_export_crud_load_all() in /var/www/html/drupal/sites/all/modules/custom_breadcrumbs/custom_breadcrumbs.module on line 184

vinmassaro’s picture

@lalweil - are you running the latest CTools? Undefined function error sounds like the module wasn't enabled. Is it possible you were trying to enable the Feature without this module installed or as a dependency of your feature?

mikemadison’s picture

You know, I thought that might have had something to do with it. I am running CTools 1.2 and made sure that the Bulk Export component was enabled.

I didn't get far enough to actually export a feature, as soon as I applied the patch I could no longer load custom breadcrumbs in the Drupal UI. So, to reiterate, the Features integration looked fine, but for some reason the CTools stuff was throwing errors, breaking Custom Breadcrumbs itself.

Currently I've patched my local installation to do the ctools_include() function throughout, and it has resolved my problem. It would be great to figure this out though so upgrading is easier in the future, and other folks won't have the same problem.

vinmassaro’s picture

I have not run into the issues in #75, can anyone else report if they are seeing this problem? Would be great to get this moving and into 2.x since there is Views support there.

mrfelton’s picture

Updated patch slightly - the previous ones use a bit of a strange export style, and features constantly detects them as overridden. This version properly keys the export items by their machine name.

colan’s picture

Status: Needs review » Needs work

This will need a re-roll for the latest dev. custom_breadcrumbs.install will need to be updated for sure.

Marking #1821928: Custom breadcrumbs views not exportable, features.inc empty as a duplicate of this issue.

mrfelton’s picture

Status: Needs work » Needs review
73.52 KB

Updated patch

liquid06’s picture

The patch in #79 didn't work for me. :(

I got custom breadcrumbs 7.x-2.x on site A, applied the patch and then created a feature. I installed the same patched version of custom breadcrumbs on site B, then copied my feature to site B and enabled it.

The feature refused to revert on site B, showing a bunch of warning messages when I tried to revert from the UI.

Warning: Illegal string offset 'machine_name' in _custom_breadcrumbs_config_set_data() (line 130 of custom_breadcrumbs/custom_breadcrumbs.features.inc).
Warning: Illegal string offset 'name' in _custom_breadcrumbs_config_set_data() (line 134 of custom_breadcrumbs/custom_breadcrumbs.features.inc).
Warning: Illegal string offset 'machine_name' in _custom_breadcrumbs_config_set_data() (line 135 of custom_breadcrumbs/custom_breadcrumbs.features.inc).
Warning: Illegal string offset 'titles' in _custom_breadcrumbs_config_set_data() (line 136 of custom_breadcrumbs/custom_breadcrumbs.features.inc).
Warning: Illegal string offset 'paths' in _custom_breadcrumbs_config_set_data() (line 137 of custom_breadcrumbs/custom_breadcrumbs.features.inc).
Warning: Illegal string offset 'visibility_php' in _custom_breadcrumbs_config_set_data() (line 138 of custom_breadcrumbs/custom_breadcrumbs.features.inc).
Warning: Illegal string offset 'language' in _custom_breadcrumbs_config_set_data() (line 139 of custom_breadcrumbs/custom_breadcrumbs.features.inc).
Warning: Illegal string offset 'node_type' in _custom_breadcrumbs_config_set_data() (line 140 of custom_breadcrumbs/custom_breadcrumbs.features.inc).

fluffy’s picture

patch at #79:
Performed update: custom_breadcrumbs_views_update_7000 Invalid argument supplied for foreach() custom_breadcrumbs.install:237

Does not add machine_name's to existing breadcrumb definitions, manually saving the definition gets the machine_name.

There is no way to set your own machine_name?

The same problem as #80, the Feature stays in overwritten mode and refuses to revert.

kemsnake’s picture

fix #79 patch. remove execute() after db_query

fluffy’s picture

the patch #82 fails to apply:

fatal: git apply: bad git-diff - expected /dev/null on line 4

because the patch file is in Windows format, I tried to change that to Unix but that did not help:

fatal: corrupt patch at line 1821

vinmassaro’s picture

Here is a copy of #82 that works. Please test! :)

danylevskyi’s picture

vinmassaro, thanks for your work!
Currently Drush can't apply patch listed in make file. :(

vinmassaro’s picture

@danylevskyi: are you patching against 7.x-2.x? The patch works for me:

vincentmassaro$ patch -p1 < ~/Downloads/custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-84.patch 
patching file custom_breadcrumbs.features.inc
patching file custom_breadcrumbs.info
patching file custom_breadcrumbs.install
patching file custom_breadcrumbs.module
patching file custom_breadcrumbs_panels/custom_breadcrumbs_panels.features.inc
patching file custom_breadcrumbs_panels/custom_breadcrumbs_panels.info
patching file custom_breadcrumbs_panels/custom_breadcrumbs_panels.install
patching file custom_breadcrumbs_panels/custom_breadcrumbs_panels.module
patching file custom_breadcrumbs_paths/custom_breadcrumbs_paths.features.inc
patching file custom_breadcrumbs_paths/custom_breadcrumbs_paths.info
patching file custom_breadcrumbs_paths/custom_breadcrumbs_paths.install
patching file custom_breadcrumbs_paths/custom_breadcrumbs_paths.module
patching file custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.features.inc
patching file custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.info
patching file custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.install
patching file custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.module
patching file custom_breadcrumbs_views/custom_breadcrumbs_views.features.inc
patching file custom_breadcrumbs_views/custom_breadcrumbs_views.info
patching file custom_breadcrumbs_views/custom_breadcrumbs_views.install
patching file custom_breadcrumbs_views/custom_breadcrumbs_views.module
patching file custom_breadcrumbsapi/custom_breadcrumbsapi.features.inc
patching file custom_breadcrumbsapi/custom_breadcrumbsapi.info
patching file custom_breadcrumbsapi/custom_breadcrumbsapi.install
patching file custom_breadcrumbsapi/custom_breadcrumbsapi.module
danylevskyi’s picture

@vinmassaro, yes I am patching against 7.x-2.x with drush make.

vinmassaro’s picture

@danylevskyi: the patch applies to 7.x-2.x HEAD, not 7.x-2.x-dev, so you will need to test it against HEAD.

fengtan’s picture

I tested #84 against HEAD. Creating the feature is fine, but I had some issues when reverting it. All fields of reverted breadcrumbs contained the 1st letter of their initial value (eg. if the breadcrumb name was 'my bc', then the reverted name would become 'm').

The issue could come from _custom_breadcrumbs_config_set_data($item) using $values[0][XXX] instead of $item[XXX].

Attached is my try to fix the problem, if it helps.

Testing plan:
git clone http://git.drupal.org/project/custom_breadcrumbs
cd custom_breadcrumbs
patch -p1 < custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-89.patch
drush updb (run update.php)
drush cc all (clear caches)

fengtan’s picture

I found a few other issues when testing #84:

  • The 1st letter problem described at #89 also happened on submodules
  • If a vocabulary has the same name as a term, and you try to export the vocabulary, then the term would be exported instead of the vocabulary
  • SQL error when running update.php : table {custom_breadcrumbs} does not exist. Think it should be {custom_breadcrumb}

I rolled a new patch to be applied against 7.x-2.x, which should fix these problems.

If anyone is up for reviewing/testing it, help yourself. Attached is also a screenshot of how it should look like.

Testing plan:

  1. git clone --branch 7.x-2.x http://git.drupal.org/project/custom_breadcrumbs.git
  2. cd custom_breadcrumbs
  3. patch -p1 < custom_breadcrumbs_features_integration_7_x_2_x_dev-579690-90.patch
  4. drush en custom_breadcrumbs custom_breadcrumbsapi etc (enable all custom_breadcrumbs modules)
  5. drush updb (run update.php)
  6. drush cc all (clear caches)
  7. go to admin/structure/custom_breadcrumbs
  8. create some breadcrumbs on nodes/views/panels/etc
  9. featurize the breadcrumbs
  10. make sure you can succesfully revert them
colan’s picture

Status: Needs review » Needs work

Thanks for working on this. Here's my commentary after reviewing the code:

(1) I'm seeing a lot of hook implementation headers like this:

+ * Implementation of hook_features_export_options. [component_hook]
+ */

These should be rewritten like "Implements hook_help()." as per https://drupal.org/coding-standards/docs#functions. There is no "[component_hook]".

(2) There are several function headers like:

+ * Basic function to retrieve the information to be exported.
+ */
+function _custom_breadcrumbs_config_features_export_item($option) {

...where there is missing documentation on parameters and return values.

(3) These types of comments don't follow the coding standards: + //loop over the items we need to recreate

(4) This needs to be fixed before we put this in:

+      // todo: using rand() won't prevent collision problems here
+      // We should check if the machine name already exists instead of appending rand().

So nothing major, but I'd still like some more folks to test it. Ideally, we'd get some automated tests with this, but if we don't, it won't be a showstopper (given enough feedback to ensure that this doesn't break anything).

realityloop’s picture

Needed a reroll for myself. Fixed all the 1's while I was at it.

realityloop’s picture

Testing this on a site I'm working on now I get the following error when tying to enable the feature that I had done export with on a fresh install:

Looking for Specify Path breadcrumbs to copy from {custom_breadcrumb}...
No Specify Path breadcrumbs were found in {custom_breadcrumb}
Looking for views breadcrumbs to copy from {custom_breadcrumb}...
No views breadcrumbs were found in {custom_breadcrumbs}

Edit: this was another issue with my feature, the custom breadcrumbs are being succesfully exported and imported via features

vinmassaro’s picture

Status: Needs work » Needs review

Reviving this for review.

subhojit777’s picture

Patch in #90 not working. All settings are lost after revert.

fengtan’s picture

Maybe this module can help: https://drupal.org/sandbox/Fengtan/2122727
It re-uses the patch of this issue but can be applied to stable releases of custom breadcrumbs (not only 7.x-dev or HEAD) while the patch is being reviewed/tested.
We added a machine name UI and some tests. Hopefully we can re-use some of them for this patch.

@subhojit777: a new bid used to be generated when reverting a crumb. Your settings probably didn't disappear but have been assigned a new bid. We fixed this in the module mentioned above. Maybe we can also port the fix in the patch as well.

rj’s picture

Sandbox module in #96 works for me. Thanks, this is great.

revagomes’s picture

The custom_breadcrumbsapi.features.inc file is missing in the #92 patch.

fengtan’s picture

The sandbox module has been turned into a full project. Might be of interest: https://drupal.org/project/custom_breadcrumbs_features

chrisgross’s picture

Issue summary: View changes

custom_breadcrumbs_features works great. any chance of getting it merged?

colan’s picture

Status: Needs review » Needs work

@chrisgross: Absolutely! As soon as all of the problems mentioned in #91, #95, and #98 are fixed. Feel free to provide a patch that folks can test.