Keyword

Fatal error in K2 Tools Module

  • Michael Yaeger
  • Michael Yaeger's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 2 months ago #160075 by Michael Yaeger
Fatal error in K2 Tools Module was created by Michael Yaeger
Every so often, I get this error in one of the sites I manage:
[16-Dec-2016 17:08:20 America/Detroit] PHP Warning:  require_once(/path/to/site/modules/mod_k2_toolsDShelper.php): failed to open stream: No such file or directory in /path/to/site/modules/mod_k2_tools/mod_k2_tools.php on line 19
[16-Dec-2016 17:08:20 America/Detroit] PHP Fatal error:  require_once(): Failed opening required '/path/to/site/modules/mod_k2_toolsDShelper.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /path/to/site/modules/mod_k2_tools/mod_k2_tools.php on line 19

This error first occurred on September 29 and has occurred many more times in the `error_log` since. Here is line 19 of `mod_k2_tools.php`:
require_once (dirname(__FILE__).DS.'helper.php');

Since `/path/to/site/modules/mod_k2_toolsDShelper.php` DOES NOT exist on the server, I'm guessing the actual path should be `/path/to/site/modules/mod_k2_tools/helper.php` since that file DOES exist.

What should be the correct reference to this file?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 2 months ago #160104 by Krikor Boghossian
Replied by Krikor Boghossian on topic Fatal error in K2 Tools Module
Hello Michael,

The file you need to edit is the "/path/to/site/modules/mod_k2_tools/mod_k2_tools.php" one, line 19.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Michael Yaeger
  • Michael Yaeger's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 2 months ago #160126 by Michael Yaeger
Replied by Michael Yaeger on topic Fatal error in K2 Tools Module

Krikor wrote: Hello Michael,

The file you need to edit is the "/path/to/site/modules/mod_k2_tools/mod_k2_tools.php" one, line 19.


What edit is needed?

Please Log in or Create an account to join the conversation.

  • Michael Yaeger
  • Michael Yaeger's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 1 month ago - 7 years 1 month ago #160172 by Michael Yaeger
Replied by Michael Yaeger on topic Fatal error in K2 Tools Module
This was suggested:

Create a defines.php file at the main website directory with the following code:

<?php define('DS', '/'); ?>


Is this the correct solution? Is there an official K2 patch for this issue?
Last edit: 7 years 1 month ago by Michael Yaeger.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 1 month ago #160264 by Krikor Boghossian
Replied by Krikor Boghossian on topic Fatal error in K2 Tools Module
This is already defined elsewhere so this is a temp solution.
99% this will also work since you it is unlikely that you are using a Windows machine. For the time being however I 'd suggest that you edit the file I mentioned.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Michael Yaeger
  • Michael Yaeger's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 1 month ago #160269 by Michael Yaeger
Replied by Michael Yaeger on topic Fatal error in K2 Tools Module
OK, I have changed:
require_once (dirname(__FILE__).DS.'helper.php');
To:
require_once (dirname(__FILE__).'/'.'helper.php');
Please update this thread and the associated bug report when an official solution/patch/update is given.

Please Log in or Create an account to join the conversation.

  • Michael Yaeger
  • Michael Yaeger's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 1 month ago - 7 years 1 month ago #160307 by Michael Yaeger
Replied by Michael Yaeger on topic Fatal error in K2 Tools Module
I received several instances of this warning/error pair in the `error_log` at one time:
[28-Jan-2017 17:27:53 America/Detroit] PHP Warning:  require_once(/path/to/siteDScomponentsDScom_k2DShelpersDSroute.php): failed to open stream: No such file or directory in /path/to/site/modules/mod_k2_tools/helper.php on line 13
[28-Jan-2017 17:27:53 America/Detroit] PHP Fatal error:  require_once(): Failed opening required '/path/to/siteDScomponentsDScom_k2DShelpersDSroute.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /path/to/site/modules/mod_k2_tools/helper.php on line 13
Line 13 of `helper.php` is:
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');

Is K2 breaking down all of the sudden? Do I need to go through all the core K2 files changing 'DS' to '/' until a patch is made? Or, is the solution suggested previously better?
Last edit: 7 years 1 month ago by Michael Yaeger.

Please Log in or Create an account to join the conversation.

  • Michael Yaeger
  • Michael Yaeger's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 1 month ago #160368 by Michael Yaeger
Replied by Michael Yaeger on topic Fatal error in K2 Tools Module

Krikor wrote: This is already defined elsewhere...


In what file can this be verified? Is there another solution besides adding a
defines.php
file?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum