The inline 'Analyse content' was prefixed with a bad base_path() call. Even without that it generates no content. It's being bound to contentanalysis_inline_analysis() but this is generating a Javascript error 'Uncaught ReferenceError: contentanalysis_inline_analysis is not defined '

contentanalysis/contentanalysis.js is loaded on the page.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jonathan_hunt’s picture

Prefixing contentanalysis_inline_analysis() works, but now all I get is the "Analyzing..." message for a second and then no further output.

@@ -339,7 +343,7 @@ function contentanalysis_analysis_form($form_state, $analysis = array(), $node =
     elseif ($report_style == 'inline') {
       $form['clickme'] = array(
         '#type' => 'markup',
-        '#markup' => '<div id="contentanalysis-buttons">' . l(t('Analyze content'), base_path() . 'contentanalysis/analyze_js', array('attributes' => array('id' => 'conten
+        '#markup' => '<div id="contentanalysis-buttons">' . l(t('Analyze content'), 'contentanalysis/analyze_js', array('attributes' => array('id' => 'contentanalysis-inin
       );    
     }
     else {
jonathan_hunt’s picture

$data['body']['output'] is empty in the analyzer example, so no content is appended to the textarea. Changing the js to inject content from data.main['output'] does append some markup but it's not yet usable.

Is there a working example of inline content analysis somewhere?

@@ -288,7 +289,7 @@ var contentanalysis = contentanalysis || {};
                          }
                    
                          $('#edit-body > .contentanalysis_section_analysis').remove();
-                         $('#edit-body').append(data.body['output']);
+                         $('#edit-body').append(data.main['output']);
larryboy360’s picture

Assigned: Unassigned » larryboy360
Issue summary: View changes

Looking at the most recent code. It looks like the JS namespace change broke the inline report button on content pages. Changing the onclick call to use the namespace will fix the initial call and adding the contantanalysis object for Drupal.settings will fix the other issue. In addition, the last round of code clean-up around 7/17/2013 introduced a bug around parsing straight text by change the logic flow when adding isset commands on the $where and $save variables in the module. I will upload a patch for the suggested changes.

larryboy360’s picture

Here's a suggested patch for the issues noted in comment #3.

larryboy360’s picture

Not to be rude or impatient, but would someone be willing to look over the patch I submitted? Thanks.

SocialNicheGuru’s picture

Status: Active » Needs review
SocialNicheGuru’s picture

FileSize
2.71 KB

tried a re-roll

ron_s’s picture

Did you test this with 7.x-1.0-beta7? I'm not having any issues when "display both dialog and inline reports" are selected, but seeing major issues if "display inline reports only" is set.

See this issue I just posted: https://www.drupal.org/project/contentanalysis/issues/2954763