+ Reply to Thread
Results 1 to 9 of 9

Thread: Any PHP/MySQL people here who can help me with a Joomla problem?

  1. #1
    Top Contributor
    Join Date
    Feb 2010
    Location
    Nr Manchester UK
    Posts
    2,112
    Thanks
    287
    Thanked 643 Times in 372 Posts
    Rep Power
    35

    Any PHP/MySQL people here who can help me with a Joomla problem?

    I've been looking for a solution to this problem for a couple of days but I'm getting nowhere. I've just set up a Joomla site but when I try to save a new category I get the error below. I've tried uninstalling and reinstalling Joomla 4 times, even tried a different version, and I've done it at root and in a sub folder. I'm now pretty sure this isn't either me making a stupid mistake or a corrupted Joomla file and multiple searches have not turned up a fix. I'm stuck.

    If anyone can point me in the right direction I'd appreciate it.

    Warning: CategoriesHelper::require_once(\nas37ent\Domains\n \nimbusantiques.co.uk\user\htdocs\new-site\administrator\components\com_content\helpers\ content.php) [categorieshelper.require-once]: failed to open stream: No such file or directory in \\nas37ent\Domains\n\xxxxxxxxxxxxxx.co.uk\user\htd ocs\new-site\administrator\components\com_categories\helpe rs\categories.php on line 46

    Fatal error: CategoriesHelper::require_once() [function.require]: Failed opening required '\nas37ent\Domains\n\nimbusantiques.co.uk\user\htd ocs\new-site\administrator\components\com_content\helpers\ content.php' (include_path='.;C:\php\pear') in \\nas37ent\Domains\n\xxxxxxxxxxxxxx.co.uk\user\htd ocs\new-site\administrator\components\com_categories\helpe rs\categories.php on line 46
    categories.php

    Code:
    <?php
    /**
     * @copyright    Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
     * @license        GNU General Public License version 2 or later; see LICENSE.txt
     */
    
    // No direct access
    defined('_JEXEC') or die;
    
    /**
     * Categories helper.
     *
     * @package        Joomla.Administrator
     * @subpackage    com_categories
     * @since        1.6
     */
    class CategoriesHelper
    {
        /**
         * Configure the Submenu links.
         *
         * @param    string    The extension being used for the categories.
         *
         * @return    void
         * @since    1.6
         */
        public static function addSubmenu($extension)
        {
            // Avoid nonsense situation.
            if ($extension == 'com_categories') {
                return;
            }
    
            $parts = explode('.', $extension);
            $component = $parts[0];
    
            if (count($parts) > 1) {
                $section = $parts[1];
            }
    
            // Try to find the component helper.
            $eName    = str_replace('com_', '', $component);
            $file    = JPath::clean(JPATH_ADMINISTRATOR.'/components/'.$component.'/helpers/'.$eName.'.php');
    
            if (file_exists($file)) {
                require_once $file;
    
                $prefix    = ucfirst(str_replace('com_', '', $component));
                $cName    = $prefix.'Helper';
    
                if (class_exists($cName)) {
    
                    if (is_callable(array($cName, 'addSubmenu'))) {
                        $lang = JFactory::getLanguage();
                        // loading language file from the administrator/language directory then
                        // loading language file from the administrator/components/*extension*/language directory
                            $lang->load($component, JPATH_BASE, null, false, false)
                        ||    $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR.'/components/'.$component), null, false, false)
                        ||    $lang->load($component, JPATH_BASE, $lang->getDefault(), false, false)
                        ||    $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR.'/components/'.$component), $lang->getDefault(), false, false);
                         call_user_func(array($cName, 'addSubmenu'), 'categories'.(isset($section)?'.'.$section:''));
                    }
                }
            }
        }
    
        /**
         * Gets a list of the actions that can be performed.
         *
         * @param    string    $extension    The extension.
         * @param    int        $categoryId    The category ID.
         *
         * @return    JObject
         * @since    1.6
         */
        public static function getActions($extension, $categoryId = 0)
        {
            $user        = JFactory::getUser();
            $result        = new JObject;
            $parts        = explode('.', $extension);
            $component    = $parts[0];
    
            if (empty($categoryId)) {
                $assetName = $component;
                $level = 'component';
            }
            else {
                $assetName = $component.'.category.'.(int) $categoryId;
                $level = 'category';
            }
    
            $actions = JAccess::getActions($component, $level);
    
            foreach ($actions as $action) {
                $result->set($action->name, $user->authorise($action->name, $assetName));
            }
    
            return $result;
        }
    }

  2. #2
    Top Contributor
    Join Date
    Oct 2010
    Location
    Cotswolds
    Posts
    787
    Thanks
    175
    Thanked 739 Times in 373 Posts
    Rep Power
    23
    It is falling over on this:


    if (file_exists($file)) { require_once $file;

    however it should only enter the if statement (to get to the second line) if the file exists...
    it is checking - so must be finding the file
    gets to line 2 and gives an error saying the file is not there!

    it is looking for:
    new-site\administrator\components\com_content\helpers\ content.php

    there shouldn't be a space in the URL - which might be an issue...
    but if that is the problem you need to trace back - the URL is creted above in the $file = line...
    and so you need to check what is feeding into $eName
    that is above - so what is in $component
    $component is from the array $parts
    $parts is formed from an exploded version of $extension
    $extension is what is being fed into the overall function at the top - no idea where it comes from...

    to test whether the space is the issue you can put:

    $file = JPath::clean(JPATH_ADMINISTRATOR.'/components/'.$component.'/helpers/content.php');
    just after the current $file line (comment out the current file line if you like (// before it))
    then re-run

    see what happens - if it works, the issue is the space...

    Alasdair

  3. The Following 2 Users Say Thank You to akirk For This Useful Post:

    Clinton (July 17th, 2012), JJMcClure (July 17th, 2012)

  4. #3
    Top Contributor
    Join Date
    Feb 2010
    Location
    Nr Manchester UK
    Posts
    2,112
    Thanks
    287
    Thanked 643 Times in 372 Posts
    Rep Power
    35
    Thanks Alasdair. I'm looking at the error message in my browser and I don't see a space, it must be something to do with the code box formatting when I cut and pasted it. I've pasted it again below.

    Warning: CategoriesHelper::require_once(\nas37ent\Domains\n \nimbusantiques.co.uk\user\htdocs\new-site\administrator\components\com_content\helpers\ content.php) [categorieshelper.require-once]: failed to open stream: No such file or directory in \\nas37ent\Domains\n\xxxxxxxxxxxxxxx.co.uk\user\ht docs\new-site\administrator\components\com_categories\helpe rs\categories.php on line 46

    Fatal error: CategoriesHelper::require_once() [function.require]: Failed opening required '\nas37ent\Domains\n\nimbusantiques.co.uk\user\htd ocs\new-site\administrator\components\com_content\helpers\ content.php' (include_path='.;C:\php\pear') in \\nas37ent\Domains\n\xxxxxxxxxxxxxxxx.co.uk\user\h tdocs\new-site\administrator\components\com_categories\helpe rs\categories.php on line 46

    I tried your suggestion anyway but it didn't fix it.

    Is this something that could be caused by a server side issue?

  5. #4
    Top Contributor
    Join Date
    Feb 2010
    Location
    Nr Manchester UK
    Posts
    2,112
    Thanks
    287
    Thanked 643 Times in 372 Posts
    Rep Power
    35
    eh? The space is there again but it's not when I go to edit the post or when I look at the actual error message in my browser - see screen shot:

    Attachment 317

    I think the space is a red herring.

  6. #5
    Top Contributor
    Join Date
    Oct 2010
    Location
    Cotswolds
    Posts
    787
    Thanks
    175
    Thanked 739 Times in 373 Posts
    Rep Power
    23
    ah - yes, that is ared herring then...

    my suspicions - and difficult to tell without seeing the stuff in real life is that this is probably a paths or permissions issue of some type...
    I assume that you have checked the file eists
    - check the permissions on it - that they are high enough / can be read - which might be why it sees it, but can't load it... put them for the moment at 777 -file / directory...
    - if permissions are fine - then it is probably to do with paths - and that might include how the server is set up...

    Alasdair

  7. The Following 2 Users Say Thank You to akirk For This Useful Post:

    Clinton (July 17th, 2012), JJMcClure (July 17th, 2012)

  8. #6
    Top Contributor
    Join Date
    Feb 2010
    Location
    Nr Manchester UK
    Posts
    2,112
    Thanks
    287
    Thanked 643 Times in 372 Posts
    Rep Power
    35
    Ok mate, thanks for the help. I'm under pressure from the client so I've hired a programmer, I'll post the solution if you're interested to know what happened.

  9. #7
    Top Contributor
    Join Date
    Oct 2010
    Location
    Cotswolds
    Posts
    787
    Thanks
    175
    Thanked 739 Times in 373 Posts
    Rep Power
    23
    do...

    Alasdair

  10. #8
    Top Contributor
    Join Date
    Feb 2010
    Location
    Nr Manchester UK
    Posts
    2,112
    Thanks
    287
    Thanked 643 Times in 372 Posts
    Rep Power
    35
    Ok, the problem turned out to be caused by the site being hosted on Windows. According to the programmer JPATH_ADMINISTRATOR is broken on the server (no idea if that's common to Windows servers or just this installation, the ISP is fasthosts) there should be two backward slashes in the categories.php file where it references the file path.

    So you were right, it was a file path issue and me suggesting that to the programmer probably saved me a few dollars of his time so thanks again

  11. The Following User Says Thank You to JJMcClure For This Useful Post:

    Clinton (July 17th, 2012)

  12. #9
    Top Contributor
    Join Date
    Oct 2010
    Location
    Cotswolds
    Posts
    787
    Thanks
    175
    Thanked 739 Times in 373 Posts
    Rep Power
    23
    no problem - I don't touch windows servers (though you can tell it was windows as unix paths have / rather than \)
    glad it is now working

    Alasdair

+ Reply to Thread

Similar Threads

  1. htaccess and MySQL - possible?
    By akirk in forum Website 101
    Replies: 13
    Last Post: February 13th, 2012, 12:17 PM
  2. Wordpress / Joomla or from scratch?
    By Kiada in forum Website 101
    Replies: 7
    Last Post: April 3rd, 2011, 4:07 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts