I have an HTML, with a CSS style shee


#1

I have an HTML, with a CSS style sheet, I upload it to galleries of my 3.0 ojs, but it does not take the style sheet.


#2

Hi @proyrevistas,

Can you describe what you mean by “does not take”? Do you receive an error message?

Regards,
Alec Smecher
Public Knowledge Project Team


#3

I have Html with CSS style, but I can not implement the CSS style, in OJS 3.0.2.0, I do not reconnect it.


#4

Hi @proyrevistas,

Do you receive an error message?

Regards,
Alec Smecher
Public Knowledge Project Team


#5

not, I receive error messge!

I am a newbie, I have to enable some opicon to show them ??


#6

Hi @proyrevistas,

It’s still not clear to me what happens when you try to upload a CSS – could you describe it in detail? Maybe include screenshots?

Regards,
Alec Smecher
Public Knowledge Project Team


#7

I have, html with a css style sheet,. as the following image shows.

When uploading it to my journal, it does not recognize the CSS style.

in this way they were uploaded in the journal:
servidor

I can visualize the html online, but without style.
request your help, to be able to apply the style !!


#8

Hi @proyrevistas,

Do you have a reference to the CSS from inside your HTML?

Regards,
Alec Smecher
Public Knowledge Project Team


#9

yes, I attach html code image


#10

Hi @proyrevistas,

When you uploaded the file as a dependent file (you can see the list of dependent files by editing your HTML galley from the workflow), was it named the exact same way as your HTML expects (htmlLigeroGenerico.css)? What do you see when you edit your HTML galley?

Regards,
Alec Smecher
Public Knowledge Project Team


#11

Yes, it receives the names correctly, when viewing the galley the htmlL does not work with the style sheet, see image. or link: “http://revistas.uis.edu.co/index.php/revistaboletindegeologia/article/view/7953/8217

But if the images work:


#12

Hi @proyrevistas,

In the HTML you linked above, what does the <link> element to the article’s stylesheet look like in your raw HTML (before OJS tries to rewrite it)?

Regards,
Alec Smecher
Public Knowledge Project Team


#13

Hello, Asmecher,


#14

Hi @proyrevistas,

Hmm, that looks OK, and OJS is rewriting the link as expected. What do you get for the following SQL query?

SELECT * FROM submission_files WHERE file_id=38036;

Regards,
Alec Smecher
Public Knowledge Project Team


#15

query SQL.


#16

Hi @proyrevistas,

Ah, the file_type of text/x-asm is the problem. If you change this to text/css I suspect this will start working properly.

As for why your system detected a MIME type of text/x-asm, that’s a complicated answer. Start with this thread and see if you can determine which of the available tools OJS is using to detect MIME types; then you can likely work with that tool to figure out why it’s detecting incorrectly.

Regards,
Alec Smecher
Public Knowledge Project Team


#18

Greetings Alec,

Updating the information for the database solved the problem for the specified css file. We are doing this database update for every css file that we update as a temporary workaround while we look for a permanent solution.

We read the thread you linked and also several other thread online about this behaviour with php and fileinfo. Following the recommendations about comments, reserved words, etc, we couldn’t still solve the problem (only a change in file type from text/x-asm to text/plain)

In this extra thread it says that commenting out the mime_database_path setting in the config.inc.php cause the software to use an internal database but we did that and still is detecting the css files as text/x-asm. The thread also says about software priorities but this is not listed in any order.

So the question is, is there a way to override this priorities for the mime_database_path given in the config.inc.php? The PKP FAQs doesn’t provide additional information than the one in the extra thread.


#19

Hi @hekutoru2kx,

OJS relies on third-party toolsets (usually built into PHP) to detect file types; those tools are what’s misbehaving. If you wanted, you could edit lib/pkp/classes/core/PKPString.inc.php and find the mime_content_type function, which is where this is implemented, and force text/x-asm to map to text/css – but it would be better to work with the underlying tools to find a server-wide solution.

Regards,
Alec Smecher
Public Knowledge Project Team


#20

Hi @asmecher,

After doing a reasearch of the problem, we realize that is a common problem between php platforms with the fileinfo/mime type with css files, due to lack of ways to identify a css structure and reserved pattern words. It seems that the only way to resolve if to degrade/deactivate the fileinfo library or to customize the platform algorithm of identification.

Considering all the support given, the security politics and the structure of the ojs, we ended modifying the mime_content_type function in the PKPString.inc.php file to add the text/x-asm to the ambiguities section.

  // SUGGESTED_EXTENSION:DETECTED_MIME_TYPE => OVERRIDE_MIME_TYPE
  $ambiguities = array(
  	'css:text/x-c' => 'text/css',
  	'css:text/plain' => 'text/css',
  	'css:text/x-asm' => 'text/css',
  	'xlsx:application/zip' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
  	'xltx:application/zip' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
  	'potx:application/zip' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
  	'ppsx:application/zip' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
  	'pptx:application/zip' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
  	'sldx:application/zip' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
  	'docx:application/zip' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
  	'dotx:application/zip' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
  );

With this, the css type is correctly identified with the structure style sheets we are using.

Thanks for your guidance and keep the good work,


#21

Hi @hekutoru2kx,

Yes, that’s a good work-around. I’m thinking it’s probably best not to include it in the OJS distribution, because strictly speaking it’s incorrect to treat x-asm files as CSS, but the chances of someone legitimately uploading assembly code to the journal are vanishingly small.

Regards,
Alec Smecher
Public Knowledge Project Team