I get this error on a multilingual site, has entity translation module enabled.

Notice: Undefined index: opencalais_calaisdocumentc_tags in locale_field_entity_form_submit() (line 438 of /var/www/html/drupal7/modules/locale/locale.module).

CKEditor toolbar also disappears when I enable Opencalais on a content type, terms show but I cannot tag the node, manually or automatically.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

azin created an issue. See original summary.

erwangel’s picture

Have a look here,
https://www.drupal.org/node/2556131
this resolved the undefined index issue in multilingual sites but since v1.2 this is not enough

erwangel’s picture

Finally, I don't think this issue is related to translations on multilingual sites but rather to the "Collect Tags into Vertical Tab" option in opencalais parameters (admin/config/content/opencalais/settings) which makes a fieldset to contain all opencalais fields but then opencalais fields are not at top level of $form array but inside a $form['opencalais'] key.
See it here in opencalais_form_node_form_alter:

      foreach ($fields as $field_name) {
        $form['opencalais'][$field_name] = $form[$field_name];
        unset($form[$field_name]);
      }

Core locale module is not aware of this change and, because it is based on the bundles structure to test the form's values, it still looks at $form[$field_name] instead of $form['opencalais'][$field_name] which causes the error. See it here: (locale_field_entity_form_submit, lines 435-438)

    foreach (field_info_instances($entity_type, $bundle) as $instance) {
      $field_name = $instance['field_name'];
      $field = field_info_field($field_name);
      $previous_language = $form[$field_name]['#language'];

This is valid even in v1.2, don't care about what I wrote in my previous message :)
Conclusion: don't use Vertical Tab until an other coding is available

azin’s picture

I did this:

Unchecked "Collect Tags into Vertical Tab" /admin/config/content/opencalais/settings
Checked Bulk processing on Cron

On the content type,
Selected "automatic & manual tagging"
Selected "Index all node text fields"
Selected two vocabularies

CKEditor does not show, content tags are suggested, but I cannot manually tag, changing any of the options does not help eigher.

erwangel’s picture

I see, I had CKEditor disappearing also. I think you'll have to follow the other subject I suggested on my first reply #2. Also, my first post on the issue at https://www.drupal.org/node/2405269 may be useful to understand why CKEditor toolbar doesn't appear any more while editing a node. Of course, don't hack original files, back up them and make any changes in a copy of your files. Unfortunately I don't have the needed time to learn making patches (my progress is very slow on that), and I can only propose dirty solutions with no guarantee.

azin’s picture

I am okay with no CKEditor, the problem is, I cannot click and select Opencalais suggestons to tag nodes, automated tagging also fails.

ElusiveMind’s picture

This looks like it might be some kind of Javascript issue. I am looking into it this morning.

ElusiveMind’s picture

Assigned: Unassigned » ElusiveMind
Priority: Major » Critical
ElusiveMind’s picture

See if this patch addresses this specific issue, not the CKEditor/JS one which should be a separate issue

ElusiveMind’s picture

Status: Active » Needs review
azin’s picture

Works, let me try and break it if I can.

CKEditor is handled in other open issues, right?

ElusiveMind’s picture

The CKEditor issue should be handled in

https://www.drupal.org/node/2405269

azin’s picture

The patch works inside vertical tabs and outside, the CKEditor patch worked in both the tests as well. I will try it on a couple of more complex sites I have and report back.

Bulk tagging on Cron didn't work ever, no log messages either (I use Elysia Cron with a special opencalais_cron channel that runs every five minuets, the job execution time is 0seconds)

ElusiveMind’s picture

This patch is not on the main repository on github. Once passed, will move it here.

https://bitbucket.org/mrbagnall/opencalais

ElusiveMind’s picture

now in dev branch - Messed up the attribution

  • ElusiveMind committed c1a6626 on 7.x-1.x
    Issue #2745813 by ElusiveMind, erwangel: Notice: Undefined index:...
erwangel’s picture

It works ! with 7.x-1.3+3-dev (2016-Aug-31), both with vertical tabs or not. Tested on two sites, one simple + one very complex. No more problem with CKEditor. Also opencalais_cron is running each time cron (Elysia cron) is running (perhaps we should open a feature request ticket for improving the admin/config/content/opencalais/bulk report with nb_proccessed/total_nb_to_be_proccessed)