This module provides a new format for the Link field type. This format presents the file as a fully rendered object within a web page - i.e. it displays the contents of the link as appropriate to its filetype (Adobe Acrobat .pdf, Microsoft Word .doc/.docx, Micrososft Excel .xls/.xlsx, Microsoft Powerpoint .ppt/.pptx), using the Google Docs embedded rendering engine.

N.B.: Only link having .pdf,.doc/.docx, .xls/.xlsx. and .ppt/.pptx may use this formatter - Google Docs must be able to access the link url in order to render and display it. In other words, it won't work on a typical development laptop, or if your server is behind a firewall where Google is unable to access it.

Also this module helps play audio files and render images hosted on another server.

Sandbox project link: https://www.drupal.org/sandbox/mandarmbhagwat78/2294289

 git clone --branch 7.x-1.x https://git.drupal.org/sandbox/mandarmbhagwat78/2294289.git link_field_formatter
cd link_field_formatter 
CommentFileSizeAuthor
#9 link-field-formatter.png273.7 KBmandarmbhagwat78
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mandarmbhagwat78 created an issue. See original summary.

visabhishek’s picture

Issue summary: View changes
PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpsgitdrupalorgsandboxmandarmbhagwat782294...

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

mandarmbhagwat78’s picture

Status: Needs work » Needs review

Fixes made as per errors reported by automated review tools.

Sharique’s picture

Status: Needs review » Reviewed & tested by the community

I tested this modules for couple of scenarios and it works fine for me and didn't find an issue.
No coding standard issue found.

poojasharmaece’s picture

Status: Reviewed & tested by the community » Needs work

1: All user facing text should be Pass through t()

Example "Download" text in following code

  if ($user->uid == $file->uid && user_access('download own audio files')) {
    $output .= '<div class="audio-download"><b>Download:</b>' . theme('link', array('path' => $audiofile)) . '</div>';
  }
  elseif (user_access('download all audio files')) {
    $output .= '<div class="audio-download"><b>Download:</b>' . theme('link', array('path' => $audiofile)) . '</div>';
  }

Some more examples :

  if ($video_style == 'vzaar') {
    $output = '<video width="' . $width . '" height="' . $height . '" ' . implode(' ', $attributes) . '>
      <source src="' . $videofile . '/video">Your browser does not support the video tag.</video>';
  }
  else {
    $output = '<video width="' . $width . '" height="' . $height . '" ' . implode(' ', $attributes) . '>
      <source src="' . $videofile . '" type="video/' . $video_style . '">Your browser does not support the video tag.</video>';
  }

2: Please set the default branch

Git errors:

Review of the 7.x-1.x branch (commit 08e98cd):

  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

mandarmbhagwat78’s picture

Status: Needs work » Needs review

Changes made as per review comments above.

Arkener’s picture

Status: Needs review » Needs work

The .module and .inc file are full with undefined variables, including but not limited to the following:

Play audio with download link:
Notice: Undefined variable: audio_style in link_field_formatter_field_formatter_view() (line 352 of /usr/share/nginx/html/drupal7/sites/all/modules/contrib/link_field_formatter/link_field_formatter.module).
Notice: Undefined variable: audio_style in link_field_formatter_field_formatter_view() (line 357 of /usr/share/nginx/html/drupal7/sites/all/modules/contrib/link_field_formatter/link_field_formatter.module).

Play audio without download link:
Notice: Undefined variable: audio_style in link_field_formatter_field_formatter_view() (line 368 of /usr/share/nginx/html/drupal7/sites/all/modules/contrib/link_field_formatter/link_field_formatter.module).
Notice: Undefined variable: audio_style in link_field_formatter_field_formatter_view() (line 373 of /usr/share/nginx/html/drupal7/sites/all/modules/contrib/link_field_formatter/link_field_formatter.module).

When using Video formatter:
Notice: Undefined variable: video_style in link_field_formatter_field_formatter_view() (line 423 of /usr/share/nginx/html/drupal7/sites/all/modules/contrib/link_field_formatter/link_field_formatter.module).
Notice: Undefined variable: attributes in link_field_formatter_field_formatter_view() (line 424 of /usr/share/nginx/html/drupal7/sites/all/modules/contrib/link_field_formatter/link_field_formatter.module).
Notice: Undefined variable: attributes in theme_link_field_formatter_video() (line 203 of /usr/share/nginx/html/drupal7/sites/all/modules/contrib/link_field_formatter/link_field_formatter.inc).
Warning: implode(): Invalid arguments passed in theme_link_field_formatter_video() (line 203 of /usr/share/nginx/html/drupal7/sites/all/modules/contrib/link_field_formatter/link_field_formatter.inc).

The audio player seems to be throwing fatal errors on the link rendering:

Audio (Player):
Recoverable fatal error: Argument 1 passed to drupal_attributes() must be of the type array, null given, called in /usr/share/nginx/html/drupal7/includes/theme.inc on line 1739 and defined in drupal_attributes() (line 2435 of /usr/share/nginx/html/drupal7/includes/common.inc).

Audio (Embed):
Recoverable fatal error: Argument 1 passed to drupal_attributes() must be of the type array, null given, called in /usr/share/nginx/html/drupal7/includes/theme.inc on line 1739 and defined in drupal_attributes() (line 2435 of /usr/share/nginx/html/drupal7/includes/common.inc).

mandarmbhagwat78’s picture

Status: Needs work » Needs review
FileSize
273.7 KB

Fixes made as reported in the comment. PFA screenshot.

Drupal8’s picture

I have tested local and with pareview.sh. The things i have found are :

FILE: ...README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 83 | WARNING | Line exceeds 80 characters; contains 83 characters
----------------------------------------------------------------------

Time: 362ms; Memory: 4Mb

FILE: ...link_field_formatter.module
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 376 | WARNING | Unused variable $weight.
----------------------------------------------------------------------

Time: 217ms; Memory: 5.25Mb

FILE: ...link_field_formatter.inc
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 12 | WARNING | Unused global variable $user.
 35 | WARNING | Unused global variable $user.
----------------------------------------------------------------------

Time: 117ms; Memory: 3.25Mb

Nice comments, really helped work with it.
I didn't find anything serious.

klausi’s picture

@Drupal8: looks like you forgot to change the status. Anything else that you found other than the minor coding standard issues or should this be set to RTBC?

Drupal8’s picture

Status: Needs review » Reviewed & tested by the community

No serious issue.

PA robot’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2858820

Project 2: https://www.drupal.org/node/2840573

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

I'm a robot and this is an automated message from Project Applications Scraper.

apaderno’s picture

Related issues: +#2858820: [D8] SSL Validator