Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcoded filepath in generated php files in /modules/AOS_PDF_Templates/PDF_Lib/ttfonts/ #9235

Open
LeoZandvliet opened this issue Jul 15, 2021 · 0 comments
Labels
Area: Clean Up Issues & PRs related to all things regarding to technical debt and log files Area: PDFs Issues & PRs related to all things regarding PDFs Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Type: Bug Bugs within the core SuiteCRM codebase

Comments

@LeoZandvliet
Copy link

LeoZandvliet commented Jul 15, 2021

Issue

Creation of *.php files containing complete filepath in directory:
/public_html/modules/AOS_PDF_Templates/PDF_Lib/ttfontdata/

The following php files are created there:

  • dejavusanscondensed.cw127.php
  • dejavusanscondensed.mtx.php
  • dejavusanscondensedB.mtx.php
  • dejavusanscondensedBI.mtx.php

My issue is that they contain the full path to a font file, instead of a relative path.

Snippet of a file above:

<?php
$name='DejaVuSansCondensed-BoldOblique';
$type='TTF';
...
$ttffile='/var/www/myfakedomain/public_html/modules/AOS_PDF_Templates/PDF_Lib/ttfonts/DejaVuSansCondensed-BoldOblique.ttf';

Expected Behavior

A 'dynamic' absolute file path so it won't bother GIT repository

Example:

$ttffile=realpath( dirname( __FILE__ ) . '../ttfonts/DejaVuSansCondensed-BoldOblique.ttf');

Actual Behavior

The full path as string is put in the generated php files.
The files itself are not ignored and appear as untracked files:

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	modules/AOS_PDF_Templates/PDF_Lib/ttfontdata/dejavusanscondensed.cw.dat
	modules/AOS_PDF_Templates/PDF_Lib/ttfontdata/dejavusanscondensed.mtx.php

Possible Fix

  1. See expected behavior
  2. Or, exclude the files *.cw.dat and *.mtx.php in directory "modules/AOS_PDF_Templates/PDF_Lib/ttfontdata" from git ?

Steps to Reproduce

I can't find code that these ttfontdata files actually creates.
After a fresh Suitecrm v7.11.20 install, one did appear after creating a pdf template and printing a Quote with it.

Context

Using GIT

Your Environment

  • SuiteCRM Version used: v7.11.8 & v7.11.20
  • Environment name and version (e.g. MySQL, PHP 7): PHP 7.3 & v7.4
  • Operating System and version (e.g Ubuntu 16.04): CentOS 7 & Ubuntu 18
@johnM2401 johnM2401 added Area: Clean Up Issues & PRs related to all things regarding to technical debt and log files Area: PDFs Issues & PRs related to all things regarding PDFs Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Type: Bug Bugs within the core SuiteCRM codebase labels Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Clean Up Issues & PRs related to all things regarding to technical debt and log files Area: PDFs Issues & PRs related to all things regarding PDFs Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Type: Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

2 participants