In the admin section, on the module settings tab, what is the proper way to use the stylesheet URL setting? I have copied the original print.css file into my theme's css folder and am trying to get this setting correct so the module will use my file for styling the printed output.

Currently, my print.css file is located here;

drupal/sites/example.com/themes/genesis_sub/css/print.css

What do I need to enter in the URL setting, and how are the 'macros' %b and %t supposed to be used? I understand they are for base path and theme path, respectively, but there's no indication if they are supposed to be used together, or need to be used at all.

Thanks for the help.

Issue fork print-671972

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kbrum’s picture

Status: Active » Fixed

Solution found.

After several iterations I discovered that both macros are required when the print.css file is moved under the theme;

example;
%b%t/css/print.css

It would be nice to have something written in the readme.txt file about these variables and examples of their use.

This is a really neat module. Thanks for all the hard work it took for development and maintaining.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mvc’s picture

Version: 6.x-1.10 » 7.x-2.0-beta1
Status: Closed (fixed) » Needs review

I would like to suggest that this be added to README.txt:

Old text:
To modify the template of printer friendly pages, simply edit the print.tpl.php or the css/print.css files.

New text:
To modify the template of printer friendly pages, simply copy the print.tpl.php or the css/print.css files to your theme directory. To use your custom CSS file instead of the default, go to Administration > Configuration > User interface > Printer, email and PDF versions > Settings and enter the location of your file, such as %t/css/print.css (the placeholder %t will be replaced with the directory of your theme).

The idea here is to discourage people from modifying the copy of print.css or print.tpl.php which ship with the module, as these changes will be wiped out whenever the module is updated.

donpwinston’s picture

This does not appear to work for "PDF version". It only works for "Printer-friendly version". Am I doing anything wrong?

I must be because it would be useless.

mvc’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev
Issue summary: View changes

pointing to HEAD so this gets noticed.

littlepixiez’s picture

I can't get the css customisation to show up on the PDF versions either... I hope this gets resolved soon.

schifazl’s picture

This is a strange issue I'm having too. I say strange because locally works, but on the production site it doesn't.

prabhatjn’s picture

Component: Documentation » Code
Priority: Normal » Critical
Status: Needs review » Active

Yes css is not working on the pdf pages, so I am updating this issue as this is a critical issue for me.

P.

prabhatjn’s picture

At least the inline styles are working, I am going to use that until someone fix this issue.

Thanks,
P.

milos.kroulik’s picture

Title: Custom print.css File » Custom print.css File doesn't work for generated PDF files
graper’s picture

The problem seems to be dependent on the order that the pdf file is added to the array for style sheets.

The css file that is save in the module's admin page is added to the list of stylesheets in file print.pages.inc on line 382. The use of drupal_add_css does not include a group option.

changing the line from

drupal_add_css(strtr($print_css, array('%t' => drupal_get_path('theme', variable_get('theme_default')))));

to

drupal_add_css(strtr($print_css, array('%t' => drupal_get_path('theme', variable_get('theme_default')))), array('group' => CSS_THEME) );

is a start. this allows the css in the print module settings to be output when the theme css files are output. This helped me with a theme that had stylesheets in the info file, which were output last.

with the group options being a number, the following line will definitely ensure that the print module settings' css file is output last for any of the print modules output.

drupal_add_css(strtr($print_css, array('%t' => drupal_get_path('theme', variable_get('theme_default')))), array('group' => 10000, 'media'=>'print', 'weight' => 10000) );

roball’s picture

Priority: Critical » Normal

The same custom print.css file does work fine for both Printer-friendly and PDF output modes.

bisonbleu’s picture

I'm a bit confused...

With NO Custom stylesheet.

A - When I add body {background:#F00;} to sites/all/modules/print/css/print.css I get a red background in both 'Printer-friendly version' and 'PDF version'. I expected that.

Leaving the above CSS in (red bg) and setting Custom stylesheet to: %t/css/print.css

B - When I add body {background:#00F;} to sites/all/themes/mytheme/css/print.css I get a blue background in both 'Printer-friendly version' and 'PDF version'.

C - But, at one point before that, I added body {background:#0F0;} to sites/all/themes/mytheme/print.css and I got a green background in 'Printer-friendly version' and a blue background in 'PDF version'.

I have deleted sites/all/themes/mytheme/print.css and flushed the caches numerous times and now I seem to be getting consistent results as described in B.

p.s. I tried the code in #11 but it didn't help - it actually breaks what works right now.

Dinis’s picture

+1 here, unable to get any custom styling for the PDF version to work, though it works correctly with the 'Printer' version.

sonfd’s picture

Also experiencing this issue. Weirdly enough on my dev environment the styles get applied to the PDF version, but after deploying to another environment the styles are only applied to the printer friendly version. I suspect it has something to do with the server / file permissions?

I also see the following when clearing cache:

unlink(files/private/print_pdf/cache/2785.pdf): Permission denied file.inc:2282                                                       [warning]
unlink(files/private/print_pdf/cache/571.pdf): Permission denied file.inc:2282                                                        [warning]
rmdir(files/private/print_pdf/cache): Directory not empty file.inc:2446 

I'm using dompdf, btw.

I also don't get images. Although the broken image is linked and if I click it it takes me to the actual image file in perfect condition on the server.

sonfd’s picture

Hey all,

My issue was linked to a php setting: allow_url_fopen. I think this needs to be on, but it's a security risk, so it's disabled on most servers and is recommended disabled by drupal. The two big issues for me were Images and CSS. Here's how I was able to work around this issue:

Images: There's an option at admin/config/user-interface/print/pdf to "Access images via local file access". I enabled it because the issues in the help text aren't issues for me.

CSS: I dropped my css into a

tag in the header of the html (e.g. print[--whatever].tpl.php) BOOM! PDF styled just how I wanted it originally!
marcoka’s picture

i use TCPFD. the setting doesnt help.
i also hacked the css a inside the module directory to be sure that the code is working. the changes dont work.
i call www.foo.de/printpfd/viewname

maybe it is because it is a view?
i will try to include my css directly in the template next

marcoka’s picture

ok here is my results:

- mPdf with 2.x dev works nice. i just copied it in and boom. like 1 minute config
- dompdf...well so bad. Had it working when copying the font files manually around. images missing. 1 hour 100% fail
- TCPDF. Everything BUT the css worked. Wasnt able to get any styling (hacked module css, created a custom one, used the settings..nothing). 2 hours trying to get the css to work. fail.

drupal_lib’s picture

Great module! I am having trouble getting it to "find" my custom CSS. I have tried different variations in the common settings > custom stylesheet, such as the full path to the print.css file and %t/print.css, and it doesn't seem to be working. Any suggestions? Thanks.

cslevy’s picture

FileSize
831 bytes
cslevy’s picture

Status: Active » Needs review
annetee’s picture

I'm having the same issue as everyone else, custom CSS for PDFs is working locally and the path to the custom CSS file is correct but the CSS isn't included when I test on dev/production environments on a remote server. From this issue and https://www.drupal.org/node/2042061 I've gathered that the server isn't able to read the CSS file when the PDF is being generated, and I'm not sure how to resolve this actual issue. That said, a (slightly terrible) workaround is to include custom CSS in <style> tags within the custom template. To avoid pasting my entire CSS file I was able to make this work:

  <style>
    <?php
      $css = file_get_contents('css/print.css');
      print $css;
    ?>
  </style>

Yikes...at least it's working I suppose! Note that my custom CSS file is located within my custom module that also holds my custom template.

sonfd’s picture

I ended up tracking down my issue. The dev servers are password protected in a fashion similar to: http://www.htaccesstools.com/articles/password-protection/. Removing this password protection seemed to resolve this.

jcloys’s picture

I was able to fix by applying the patch in comment #20 and setting the custom stylesheet path using the entire path and not the macros.

charginghawk’s picture

I ran into this issue when I was using a custom module to generate a PDF from a form in a block, using pdf_using_mpdf_api() in a submit handler.

Due to pdf_using_mpdf_api() using global $theme_path;, and this running headlong into #194098: path_to_theme() returns path to module that calls it, pdf_using_mpdf_api() was looking for my css file in the blockreference module. My solution was to run:

$GLOBALS['theme_path'] = drupal_get_path('theme', $GLOBALS['theme_key']);

before running pdf_using_mpdf_api().

nubeli’s picture

The patch in #20 doesn't work for me. I think the issue is that after the patch writes the stylesheet, the next line is writing HTML including the . I think that overwrites the stylesheet (see https://mpdf.github.io/css-stylesheets/introduction.html#using-a-stylesheet). But if I change it to (so it only prints the body):

$mpdf->WriteHTML($html,2);

then it doesn't print the print template head. I also tried putting the stylesheet after writing the $mpdf->WriteHTML($html); and that doesn't seem to work either. I may just have to print stylesheet directly in the template until I've got more time to fiddle with this.

crutch’s picture

#20 did work for me on patched 2.x-dev and mPDF library using %t/css/print.css in the custom stylesheet field, disable "keep current theme css", re-save theme at appearance/theme and flush all caches.

I just don't know how to handle div elements display:inline-block;verticle-align:top;. Seems to be some inconsistency between html and pdf for inline-blocks but this would be a separate issue probably for mPDF specifically.

hkirsman’s picture

Didn't work for so added more code + %t parsing

jcnventura’s picture

Status: Needs review » Needs work

I'm confused why you on error, a drupal_set_message() is logged, but then the stylesheet is still included and added to the PDF object.

anoopsingh92’s picture

Assigned: Unassigned » anoopsingh92

Hello, I am working on this issue. I will provide the patch. Thanks

anoopsingh92’s picture

Hello,

I am trying to apply patch #20 but it is not working for me.

I am getting these errors.

Lenovo@LAPTOP-PDE747K8 MINGW64 /c/xampp/htdocs/drupal-9/web/modules/contrib/print-671972 (7.x-2.x)
$ git apply -v print-mpdf-css-fix.patch
print-mpdf-css-fix.patch:14: trailing whitespace.

Checking patch print_pdf/lib_handlers/print_pdf_mpdf/print_pdf_mpdf.pages.inc...
error: while searching for:
  // $mpdf->SetProtection(array('copy', 'print', 'print-highres'), '', '');
  drupal_alter('print_pdf_mpdf', $mpdf, $html, $meta);

  $mpdf->WriteHTML($html);

  // try to recover from any warning/error

error: patch failed: print_pdf/lib_handlers/print_pdf_mpdf/print_pdf_mpdf.pages.inc:56
error: print_pdf/lib_handlers/print_pdf_mpdf/print_pdf_mpdf.pages.inc: patch does not apply

Thanks

anoopsingh92’s picture

Hello,

I have fixed all these issues from this.

Lenovo@LAPTOP-PDE747K8 MINGW64 /c/xampp/htdocs/drupal-9/web/modules/contrib ((4106d4a...))
$ phpcbf --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig print-671972/

PHPCBF RESULT SUMMARY
-----------------------------------------------------------------------------------------------------------------------------------------------------------
FILE                                                                                                                                       FIXED  REMAINING
-----------------------------------------------------------------------------------------------------------------------------------------------------------
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\css\print-rtl.css                                                                1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\css\print.css                                                                    1      3
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\includes\print.drush.inc                                                         1      3
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\includes\print.inc                                                               1      3
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print.admin.inc                                                                  4      1
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print.api.php                                                                    1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print.install                                                                    1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print.module                                                                     4      3
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print.pages.inc                                                                  10     9
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print.tpl.php                                                                    2      1
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print.views.inc                                                                  1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\lib_handlers\print_epub_phpepub\print_epub_phpepub.drush.inc          1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\lib_handlers\print_epub_phpepub\print_epub_phpepub.install            1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\lib_handlers\print_epub_phpepub\print_epub_phpepub.module             2      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\lib_handlers\print_epub_phpepub\print_epub_phpepub.pages.inc          2      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\print_epub.admin.inc                                                  1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\print_epub.api.php                                                    1      2
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\print_epub.drush.inc                                                  1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\print_epub.install                                                    2      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\print_epub.module                                                     1      4
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\print_epub.pages.inc                                                  1      1
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\print_epub.views.inc                                                  1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_join_page_counter.inc                                                      1      7
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_mail\css\print_mail.theme-rtl.css                                          1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_mail\css\print_mail.theme.css                                              1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_mail\print_mail.admin.inc                                                  1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_mail\print_mail.inc                                                        2      18
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_mail\print_mail.install                                                    1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_mail\print_mail.module                                                     1      6
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_mail\print_mail.views.inc                                                  1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_dompdf\print_pdf_dompdf.admin.inc               2      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_dompdf\print_pdf_dompdf.drush.inc               1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_dompdf\print_pdf_dompdf.install                 1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_dompdf\print_pdf_dompdf.module                  1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_dompdf\print_pdf_dompdf.pages.inc               2      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_mpdf\print_pdf_mpdf.drush.inc                   1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_mpdf\print_pdf_mpdf.module                      4      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_mpdf\print_pdf_mpdf.pages.inc                   4      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_tcpdf\print_pdf_tcpdf.admin.inc                 2      5
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_tcpdf\print_pdf_tcpdf.class.inc                 2      4
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_tcpdf\print_pdf_tcpdf.drush.inc                 1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_tcpdf\print_pdf_tcpdf.install                   1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_tcpdf\print_pdf_tcpdf.module                    1      1
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_tcpdf\print_pdf_tcpdf.pages.inc                 6      6
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_wkhtmltopdf\print_pdf_wkhtmltopdf.admin.inc     1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_wkhtmltopdf\print_pdf_wkhtmltopdf.drush.inc     1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_wkhtmltopdf\print_pdf_wkhtmltopdf.install       1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_wkhtmltopdf\print_pdf_wkhtmltopdf.module        1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_wkhtmltopdf\print_pdf_wkhtmltopdf.pages.inc     1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\print_pdf.admin.inc                                                    1      16
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\print_pdf.api.php                                                      1      2
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\print_pdf.drush.inc                                                    1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\print_pdf.install                                                      1      1
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\print_pdf.module                                                       5      7
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\print_pdf.pages.inc                                                    4      1
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\print_pdf.views.inc                                                    1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_ui\css\print_ui.theme-rtl.css                                              1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_ui\css\print_ui.theme.css                                                  1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_ui\print_ui.admin.inc                                                      4      15
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_ui\print_ui.api.php                                                        1      1
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_ui\print_ui.install                                                        1      0
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_ui\print_ui.module                                                         8      11
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\README.txt                                                                       1      1
C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\tests\print_basic.test                                                           1      3
-----------------------------------------------------------------------------------------------------------------------------------------------------------
A TOTAL OF 116 ERRORS WERE FIXED IN 64 FILES
-----------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 5.38 secs; Memory: 22MB

Thanks

anoopsingh92’s picture

Hello,

I have fixed a lot of issues but some issues are still pending. I am listing all pending issues here. I will provide the patch for this.

Lenovo@LAPTOP-PDE747K8 MINGW64 /c/xampp/htdocs/drupal-9/web/modules/contrib ((4106d4a...))
$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig print-671972/

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\includes\print.inc
----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------
 42 | ERROR | Type hint "array" missing for $matches
----------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print.module
----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------
 393 | ERROR | Type hint "array" missing for $args
----------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print.pages.inc
-------------------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 8 LINES
-------------------------------------------------------------------------------
  14 | WARNING | Unused variable $_print_urls.
 230 | ERROR   | Type hint "array" missing for $vars
 250 | ERROR   | Type hint "array" missing for $vars
 280 | ERROR   | Type hint "array" missing for $vars
 316 | ERROR   | Type hint "array" missing for $vars
 348 | ERROR   | Type hint "array" missing for $vars
 453 | ERROR   | Type hint "array" missing for $matches
 585 | ERROR   | Type hint "Object" missing for $node
-------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\print_epub.api.php
---------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------
 33 | ERROR | Type hint "array" missing for $meta
 66 | ERROR | Type hint "array" missing for $epub_tools
---------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\print_epub.module
--------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------
 179 | ERROR | Type hint "array" missing for $args
 206 | ERROR | Type hint "array" missing for $meta
--------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_epub\print_epub.pages.inc
-----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 108 | ERROR | Type hint "array" missing for $query
-----------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_join_page_counter.inc
-----------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
-----------------------------------------------------------------------------------------------------------------
 12 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
 13 | ERROR   | Class name must begin with a capital letter
 13 | ERROR   | Class name must use UpperCamel naming without underscores
 15 | ERROR   | Missing short description in doc comment
 18 | WARNING | Possible useless method overriding detected
 25 | ERROR   | Missing short description in doc comment
 28 | ERROR   | Public method name "print_join_page_counter::build_join" is not in lowerCamel format
-----------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_mail\print_mail.inc
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 6 WARNINGS AFFECTING 11 LINES
----------------------------------------------------------------------------------------------------------------------------------------
  78 | ERROR   | Type hint "array" missing for $form
  78 | ERROR   | Type hint "array" missing for $form_state
  78 | ERROR   | Type hint "array" missing for $query
  78 | ERROR   | Type hint "Object" missing for $user
  80 | WARNING | Redeclaration of function parameter $user as global variable.
 115 | WARNING | Do not use the raw $form_state['input'], use $form_state['values'] instead where possible
 202 | ERROR   | The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
 258 | ERROR   | Type hint "array" missing for $variables
 293 | ERROR   | Type hint "array" missing for $params
 311 | ERROR   | Type hint "array" missing for $params
 324 | WARNING | Do not use the raw $form_state['input'], use $form_state['values'] instead where possible
 325 | WARNING | Form error messages are user facing text and must run through t() for translation
 379 | WARNING | Form error messages are user facing text and must run through t() for translation
 397 | WARNING | Do not use the raw $form_state['input'], use $form_state['values'] instead where possible
----------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_mail\print_mail.module
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
----------------------------------------------------------------------------------------------------------------------------------------
 112 | WARNING | Only string literals should be passed to t() where possible
 142 | ERROR   | The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
 182 | ERROR   | Type hint "array" missing for $data
 331 | ERROR   | Type hint "array" missing for $args
 394 | ERROR   | The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
 430 | WARNING | Do not use the raw $form_state['input'], use $form_state['values'] instead where possible
----------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_tcpdf\print_pdf_tcpdf.admin.inc
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 3 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 27 | WARNING | All variables defined by your module must be prefixed with your module's name to avoid name collisions with others. Expected start with "print_pdf_tcpdf" but found "print_pdf_font_family"
 36 | WARNING | All variables defined by your module must be prefixed with your module's name to avoid name collisions with others. Expected start with "print_pdf_tcpdf" but found "print_pdf_font_size"
 44 | WARNING | All variables defined by your module must be prefixed with your module's name to avoid name collisions with others. Expected start with "print_pdf_tcpdf" but found "print_pdf_font_subsetting"
 64 | ERROR   | Type hint "array" missing for $form
 64 | ERROR   | Type hint "array" missing for $form_state
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_tcpdf\print_pdf_tcpdf.class.inc
--------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------
 12 | ERROR   | Doc comment is empty
 15 | WARNING | Class name must be prefixed with the project name "PrintPdfTcpdf"
 16 | ERROR   | Missing member variable doc comment
 41 | ERROR   | Public method name "PrintTCPDF::Footer" is not in lowerCamel format
--------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\lib_handlers\print_pdf_tcpdf\print_pdf_tcpdf.pages.inc
--------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------------------------------------------------------
 157 | ERROR | Type hint "array" missing for $vars
 202 | ERROR | Type hint "array" missing for $vars
 231 | ERROR | Type hint "array" missing for $vars
 274 | ERROR | Type hint "array" missing for $vars
 306 | ERROR | Type hint "array" missing for $vars
--------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\print_pdf.admin.inc
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 13 WARNINGS AFFECTING 15 LINES
----------------------------------------------------------------------------------------------------------------------------------------
  64 | ERROR   | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
  79 | WARNING | #options values usually have to run through t() for translation
  80 | WARNING | #options values usually have to run through t() for translation
  81 | WARNING | #options values usually have to run through t() for translation
  82 | WARNING | #options values usually have to run through t() for translation
  83 | WARNING | #options values usually have to run through t() for translation
  84 | WARNING | #options values usually have to run through t() for translation
  85 | WARNING | #options values usually have to run through t() for translation
  86 | WARNING | #options values usually have to run through t() for translation
  87 | WARNING | #options values usually have to run through t() for translation
  88 | WARNING | #options values usually have to run through t() for translation
  89 | WARNING | #options values usually have to run through t() for translation
  90 | WARNING | #options values usually have to run through t() for translation
  91 | WARNING | #options values usually have to run through t() for translation
 173 | ERROR   | Type hint "array" missing for $form
 173 | ERROR   | Type hint "array" missing for $form_state
----------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\print_pdf.api.php
-------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------
  86 | ERROR | Type hint "array" missing for $meta
 114 | ERROR | Type hint "array" missing for $pdf_tools
-------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\print_pdf.module
------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
------------------------------------------------------------------------------------------
 296 | WARNING | #options values usually have to run through t() for translation
 358 | ERROR   | Type hint "array" missing for $args
 485 | ERROR   | Type hint "array" missing for $meta
------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_pdf\print_pdf.pages.inc
---------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
 108 | ERROR | Type hint "array" missing for $query
---------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_ui\print_ui.admin.inc
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 8 WARNINGS AFFECTING 9 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  33 | WARNING | All variables defined by your module must be prefixed with your module's name to avoid name collisions with others. Expected start with "print_ui" but found "print_"
  46 | WARNING | All variables defined by your module must be prefixed with your module's name to avoid name collisions with others. Expected start with "print_ui" but found "print_"
  68 | WARNING | All variables defined by your module must be prefixed with your module's name to avoid name collisions with others. Expected start with "print_ui" but found "print_"
  80 | WARNING | All variables defined by your module must be prefixed with your module's name to avoid name collisions with others. Expected start with "print_ui" but found "print_"
  87 | WARNING | All variables defined by your module must be prefixed with your module's name to avoid name collisions with others. Expected start with "print_ui" but found "print_"
  97 | WARNING | All variables defined by your module must be prefixed with your module's name to avoid name collisions with others. Expected start with "print_ui" but found "print_"
 106 | WARNING | All variables defined by your module must be prefixed with your module's name to avoid name collisions with others. Expected start with "print_ui" but found "print_"
 138 | WARNING | All variables defined by your module must be prefixed with your module's name to avoid name collisions with others. Expected start with "print_ui" but found "print_"
 166 | ERROR   | Type hint "array" missing for $variables
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_ui\print_ui.api.php
-----------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------
 74 | ERROR | Type hint "array" missing for $args
-----------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_ui\print_ui.module
----------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------------
 607 | ERROR | Type hint "array" missing for $link
 607 | ERROR | Type hint "array" missing for $args
 680 | ERROR | Type hint "array" missing for $link
 680 | ERROR | Type hint "array" missing for $args
 812 | ERROR | Type hint "array" missing for $query
 812 | ERROR | Type hint "array" missing for $exclude
----------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\tests\print_basic.test
-----------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------
 14 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
 16 | ERROR   | Missing member variable doc comment
 17 | ERROR   | Missing member variable doc comment
-----------------------------------------------------------------------------------------------------------------

Time: 1.45 secs; Memory: 18MB

Thanks

anoopsingh92’s picture

FileSize
39.55 KB

Hello,

I have fixed some issues in this Patch. Please review this.

Thanks

anoopsingh92’s picture

Assigned: anoopsingh92 » Unassigned
Status: Needs work » Needs review

I am still working on the remaining issues.

anoopsingh92’s picture

Assigned: Unassigned » anoopsingh92
Status: Needs review » Needs work

Hello,

I am still working on the remaining issues of this.
I will come back with the patch shortly.

Thanks

anoopsingh92’s picture

Hello,

I have fixed most of the issues only the listed issues are pending.

Lenovo@LAPTOP-PDE747K8 MINGW64 /c/xampp/htdocs/drupal-9/web/modules/contrib ((4106d4a...))
$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig print-671972/

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print.pages.inc
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------
 14 | WARNING | Unused variable $_print_urls.
-------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\print-671972\print_join_page_counter.inc
-------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
 20 | WARNING | Possible useless method overriding detected
-------------------------------------------------------------------------------------------

Time: 1.61 secs; Memory: 18MB

Providing the latest patch shortly.

Thanks

anoopsingh92’s picture

FileSize
67.9 KB

Hello,

I have fixed most of the issues in this patch please review it.

Thanks

anoopsingh92’s picture

Assigned: anoopsingh92 » Unassigned
Status: Needs work » Needs review