OJS3 - Hide all supplementary files

Hi

Is there a easy way to hide all supplementary files in ojs3 (3.1.1.2)?
We have a lot of confidencial files as supplementary files and it’s online and open.

Regards,
Tarcisio Pereira

Can I run the followings queries?

My ideia is back all supplementary files to stage 11 (Production Ready Files) and delete all galleys linked to then.

begin;
update submission_files set file_stage = 11 where file_id in(
select file_id from submission_files where genre_id in (
select genre_id from genres where supplementary = 1
)
);
delete from submission_galley_settings where galley_id in(
select galley_id from submission_galleys where file_id in (
select file_id from submission_files where genre_id in (
select genre_id from genres where supplementary = 1
)
)
);
delete from submission_galleys where galley_id in(
select galley_id from submission_galleys where file_id in (
select file_id from submission_files where genre_id in (
select genre_id from genres where supplementary = 1
)
)
);
commit;

Hi @Tarcisio_Pereira

Have you patched your OJS with this patch when upgrading it?

Best,
Israel

1 Like

Hi @israel.cefrin,

No, I updated 20 Jun.
Is there some workaround for me?

Regards,
Tarcisio Pereira

Hi,

Some news?

Regards,
Tarcisio Pereira.

Hi @Tarcisio_Pereira

You can try this workaround:

Best,
Israel

Hi @israel.cefrin

Here I have 90,310 published articles already.
It’s impossible to manual check each one.

Is there an automated way?

Regards,
Tarcisio Pereira.

Hi!

Some news?

Regards,
Tarcisio Pereira

Hi @Tarcisio_Pereira,
we are experiencing your problem. I hid the files for now but, all galleys became hidden.
How could you handle this?

Hi @alirezaaa

I’ve edited the default template to hide supplementary galleys.
Still waiting for a solution.

Regards,
Tarcisio Pereira.

The best way to introduce any changes into templates is by creating a child theme and overriding that template: Child Themes

The link to published galleys on the front-end is here: https://github.com/pkp/ojs/blob/master/templates/frontend/objects/galley_link.tpl#L53-L73

For example, you may want to add there something like: {if !$isSupplementary} add the code for galleys here {/if}

1 Like

Hi @Vitaliy,
problem is that submission files changed to galley files during update and are now displayed on abstract page. It is very hard to manually modify these from website and I am looking for a way to change the type of these files in data base.

1 Like

Inside genres table you can find types of a submitted files. Ideally all those files that are not wanted to be exposed should fall into one of the categories which is supplementary (correspondent column near entry_key). In this case you can easily filter them out on the front-end with a described above method.

2 Likes

Hi @Tarcisio_Pereira

How many such supplementary files does your installation have? You can use this SQL to figure that out:
SELECT sf.* FROM submission_files sf, genres g, submission_supplementary_files ssf WHERE sf.file_id = ssf.file_id AND sf.revision = ssf.revision AND sf.file_stage = 10 AND sf.assoc_type = 521 AND sf.genre_id = g.genre_id AND g.supplementary = 1

Best,
Bozana

Hi @bozana

I have 3845 supplementary files.
Is there some “magic update query” to solve it? :grin:

Regards,
Tarcisio Pereira

Just to be sure: Is this the total amount of results you have found executing the SQL above? Or maybe the total amount of entries in your DB table submission_supplementary_files?

revistas3=> select count(*) from submission_supplementary_files ;
count
16518
(1 row)

and

revistas3=> SELECT count(sf.*) FROM submission_files sf, genres g, submission_supplementary_files ssf WHERE sf.file_id = ssf.file_id AND sf.revision = ssf.revision AND sf.file_stage = 10 AND sf.assoc_type = 521 AND sf.genre_id = g.genre_id AND g.supplementary = 1;
count
3845
(1 row)

Hi @Tarcisio_Pereira

Oh, yes… a lot…
I’ll try to provide a script that would move those supp file to the submission stage…

Best,
Bozana

Hi @bozana,

I’ll be waiting.
Thank you by your time,

Tarcisio Pereira

Hi @Tarcisio_Pereira

Could you please take a look/investigate how are the other supp files that are not in the result of this SQL statement: SELECT sf.* FROM submission_files sf, genres g, submission_supplementary_files ssf WHERE sf.file_id = ssf.file_id AND sf.revision = ssf.revision AND sf.file_stage = 10 AND sf.assoc_type = 521 AND sf.genre_id = g.genre_id AND g.supplementary = 1 ?
Why are they not in the result?

Thanks!
Bozana