Universal Viewer Update - Fatal Error (require_once)

Hello all,

I have tried to update my Universal Viewer module in an effort to fix an issue that I was having with PDF files not showing up on the public pages on Omeka S - following the advice in this forum post (Universal Viewer for pdf). In the process of uninstalling and then updating the module, however, I have encountered a fatal error:

**Warning** : require_once(/var/www/plantsandpeople.dk/omeka.fia/modules/Common/TraitModule.php) [[function.require-once](http://php.net/manual/en/function.require-once)]: failed to open stream: No such file or directory in **/var/www/plantsandpeople.dk/omeka.fia/modules/UniversalViewer/Module.php** on line **34**

**Fatal error** : require_once() [[function.require](http://php.net/manual/en/function.require)]: Failed opening required '/var/www/plantsandpeople.dk/omeka.fia/modules/Common/TraitModule.php' (include_path='.') in **/var/www/plantsandpeople.dk/omeka.fia/modules/UniversalViewer/Module.php** on line **34**

I have tried to do some troubleshooting and cannot find this TraitModule.php file in either the previous, or the updated Universal Viewer module. Checking the Module.php file, I can see the lines of code it is referencing:

namespace UniversalViewer;

if (!class_exists(\Common\TraitModule::class)) {
    require_once dirname(__DIR__) . '/Common/TraitModule.php';
}

But I am now confused and slightly stumped on how to proceed given that I cannot find this TraitModule.php file. Has anyone else encountered this type of error before, and does anyone have any ideas on how to get Universal Viewer back up and running on my Omeka S instance?

Many thanks in advance!

Richard W

Hi,
There is a new module Common, that is replacing module Generic in all new versions of modules that i manage. It is more flexible and avoid to duplicate many codes through modules. You can find it on gitlab (Daniel-KM / Omeka-S-module-Common · GitLab) or github (GitHub - Daniel-KM/Omeka-S-module-Common), it is not yet on omeka.org.

1 Like

Thank you Daniel!
This Fixed it! :slight_smile: