5

I am updating a clients site to 3.7.3 and following the update receive the following on both the front end and admin:

Fatal error: Class 'JInput' not found in /home/wwwsitew/public_html/rmi/libraries/joomla/application/web.php on line 149

This refers to { $this->input = new JInput; }

In the following function:

public function __construct(JInput $input = null, Registry $config = null, JApplicationWebClient $client = null)
    {
        // If an input object is given use it.
        if ($input instanceof JInput)
        {
            $this->input = $input;
        }
        // Create the input based on the application logic.
        else
        {
            $this->input = new JInput;
        }

        // If a config object is given use it.
        if ($config instanceof Registry)
        {
            $this->config = $config;
        }
        // Instantiate a new configuration object.
        else
        {
            $this->config = new Registry;
        }

        // If a client object is given use it.
        if ($client instanceof JApplicationWebClient)
        {
            $this->client = $client;
        }
        // Instantiate a new web client object.
        else
        {
            $this->client = new JApplicationWebClient;
        }

        // Load the configuration object.
        $this->loadConfiguration($this->fetchConfigurationData());

        // Set the execution datetime and timestamp;
        $this->set('execution.datetime', gmdate('Y-m-d H:i:s'));
        $this->set('execution.timestamp', time());

        // Setup the response object.
        $this->response = new stdClass;
        $this->response->cachable = false;
        $this->response->headers = array();
        $this->response->body = array();

        // Set the system URIs.
    }

I cant seem to find anything related in Google, does anyone have any ideas as to what the problem could be?


Update: I have downloaded a full copy of 3.7.3 and uploaded both /libraries/joomla/application/web.php and libraries/joomla/input/input.php but I;m now getting a 404 error for both Front end and Admin pages....


Update2: It seems the DB is running at 3.7.0, the following issues show when trying to 'fix' the DB, however they are not fixed after clicking the button:

Table 'uh46v_session' does not have column 'client_id' with type tinyint(3). (From file 3.7.0-2016-10-02.sql.) Table 'uh46v_ucm_content' does not have column 'core_content_item_id' with type int(10). (From file 3.7.0-2017-01-08.sql.) Table 'uh46v_ucm_content' does not have column 'asset_id' with type int(10). (From file 3.7.0-2017-01-08.sql.) Table 'uh46v_ucm_content' does not have column 'core_type_id' with type int(10). (From file 3.7.0-2017-01-08.sql.) Table 'uh46v_languages' does not have column 'asset_id' with type int(10). (From file 3.7.0-2017-03-03.sql.) Table 'uh46v_menu_types' does not have column 'asset_id' with type int(10). (From file 3.7.0-2017-03-03.sql.)

I have tried manual updates of earlier Joomla versions, i.e 3.6, 3.7 and also reinstalling 3.5.1 which is the current version - I'm guessing the site owner may have corrupted something when trying to update or roll back?


Update 3: I have ran the Joomla FPA and the full details can be found here

Update 4: Still no luck, all none core EXT's removed apart from Akeeba. There are some additional details here

I'm still investigating, but any suggestions welcome.


Regards D

3
  • What happens if you add use Joomla\Input\Input; to line 14 of this file?
    – Lodder
    Jul 13, 2017 at 10:56
  • I've tried heavily to replicate this error but cannot seem to do so, so my above comment probably won't solve anything. In the Joomla backend, go to Components >> Joomla Update and try reinstalling the core.
    – Lodder
    Jul 13, 2017 at 11:10
  • Thanks @Lodder, I have installed via the Joomla update multiple times, but all to no affect. I have also added a php.ini in both the main directory and admin to specify the upload_tmp_directory but this does not seem to make a difference either.
    – Dtorr1981
    Jul 14, 2017 at 10:29

1 Answer 1

1
+25

It seems your Joomla! instance is corrupted. Since using the Joomla admin does not help with the re-installation, I would suggest Do a complete Joomla! Core manual re-installation / package replacement.

Note: This probably will work better in a local clone of the website on your desktop. Generally avoid doing this on the live website directly.

Create a fresh the Joomla! Core on an existing website:

  • Download your Joomla! version (3.7.3) full stable package from joomla.org

  • Unzip it

  • Start replacing everything Joomla! core in your instance.

  • Open side by side the 2 folders where your site-clone and the unzipped fresh Joomla package reside.

Administrator Site

Navigate in each of the admin site subfolders:

a. Components, Modules, Includes folders.

  • Select all and copy the *subfolders/subcontent from fresh Joomla! of the above folders, and paste to your site. Let it replace any existing items.

    *subfolders = each core component, module folder and files -see screenshot

    Selecting all admin components

b. Help, Manifests, Languages Folder

  • Likely you won't need to replace anything for these folders- but in case you do, select the content of their subfolders, copy and paste to your site's instance. (e.g. for languages, copy the contents of the core en-EN language folder and paste them to your site - replace existing ones).

c. Templates

  • Unless you have any template overrides you can copy/paste the whole templates folder. If you have overrides, then save your overrides somewhere before replacing the templates and place them again to their previous location on the fresh templates.

Front-end Site

Navigate in each of the site subfolders:

a. bin, cli

  • Select all and copy the files of these folders from fresh Joomla! of the above folders, and paste to your site's instance. Let it replace any existing items.

b. Includes, Layouts

  • Copy the whole folders and replace on your site's instance.

c. Components, Libraries, Media, Modules

  • Copy the subfolders/contents of these folders (the ones of each module, component etc - as described for the administrator components) and replace on your site's instance.

d. Languages and Templates

  • Navigate in each plugin's folder and copy the subfolders that exist there. Replace the items with the same name on your joomla site instance.

e. Plugins

  • Similar as described for the admin site. Just note that if you are using 3rd party templates - then you need to copy from the fresh core only each subfolder that exist in the templates folder and not the whole folder.

Conclusion - things to keep in mind:

  • The above describe briefly how to completely replace the core Joomla files on an existing Joomla site - without removing 3rd party files.
  • With this general approach, it's made sure that the whole Joomla core is there.
  • Of course it's recommended that the Joomla versions should match.
  • Other specific customizations/overrides/patches over the core of the existing site will be removed.
  • If there are no 3rd party extensions and other files exist on the whole website or partially in subfolders e.g. a plugins folder, then the whole parent folder can be replaced.
  • Always have a backup - avoid doing such tasks on the live website.
  • Remember to clearing caches etc, when testing your changes.
  • I am describing/suggesting the full core re-installation with this method because likely if there is a failed Joomla installation for whatever reason, this might contain more than 1 corrupted files. However, someone could go with partial replacements of the whole Joomla package and try on each step to see if a specific issue is resolved.

Extra Tip

I have found that in some cases, during copy/paste/replace from fresh Joomla to the site, it's useful and timesaver to temporary rename and keep aside some of the existing site folders - instead of replacing them (which deletes them) - so to keep references to them in my current working environment - without the need to look to re-download/re-unzip/recreate the existing site. I can easily rename folders and switch between the 2 versions - or do comparisons etc.

2
  • Thank you, I have already tried the file/replace method to no avail using various Joomla versions from 3.5.1 upwards, to no avail. I've also ran the DB queries manually from the administrator/com_admin/ folder following each file/replace - all again without success. It seems to lean more towards a DB issue. The 'PHP temporary directory not set' message still displays, however this is not an issue on any other site....its all very odd!!!
    – Dtorr1981
    Jul 17, 2017 at 23:54
  • Just as an update, the 'PHP temporary directory not set' is still displayed even after a stock Softlaculous install - I;m not convinced its related.
    – Dtorr1981
    Jul 18, 2017 at 0:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.