Component not installing #996

Closed
opened 2023-05-05 14:09:15 +00:00 by alanwebsites · 6 comments

Steps to reproduce the issue

Hi

I've built a component and installed it. All worked until I tried to update it. It said it installed but when I try to open it is says

View class not found [class, file]: patientrecallsViewpatientrecalls, /mnt/storage/vhosts/domain.com/httpdocs/administrator/components/com_patientrecalls/views/patientrecalls/view.html.php

the file looks like this

?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
###DASH_VIEW_HTML_HEADER###
/**

  • ###Component### View class
    /
    class ###Component###View###Component### extends JViewLegacy
    {
    /
    *
  • View display method
  • @return void
    */
    function display($tpl = null)
    {
    // Assign data to the view
    $this->icons = $this->get('Icons');
    $this->contributors =
    ###Component###Helper::getContributors();###DASH_GET_CUSTOM_DATA###

// get the manifest details of the component
$this->manifest = ###Component###Helper::manifest();

so it's not been installed.

I've also noticed that the admin view won't allow viewing when clicking fields.

Any idea how I can fix or debug it?

Expected result

component to install

Actual result

As above component installs but throws above error and when I look at the files they show similar to above.

System information (as much as possible)

  • OS Name & Version: Linus
  • MySql Version: 5.5.68-MariaDB
  • Apache Version: nginx/1.20.2
  • PHP Version: 7.4.33
  • Joomla Version: Joomla! 3.10.11 Stable
  • JCB Version: 3.1.24
  • Browser: Firefox

Additional comments

### Steps to reproduce the issue Hi I've built a component and installed it. All worked until I tried to update it. It said it installed but when I try to open it is says View class not found [class, file]: patientrecallsViewpatientrecalls, /mnt/storage/vhosts/domain.com/httpdocs/administrator/components/com_patientrecalls/views/patientrecalls/view.html.php the file looks like this ?> ###BOM### // No direct access to this file defined('_JEXEC') or die('Restricted access'); ###DASH_VIEW_HTML_HEADER### /** * ###Component### View class */ class ###Component###View###Component### extends JViewLegacy { /** * View display method * @return void */ function display($tpl = null) { // Assign data to the view $this->icons = $this->get('Icons'); $this->contributors = ###Component###Helper::getContributors();###DASH_GET_CUSTOM_DATA### // get the manifest details of the component $this->manifest = ###Component###Helper::manifest(); so it's not been installed. I've also noticed that the admin view won't allow viewing when clicking fields. Any idea how I can fix or debug it? ### Expected result component to install ### Actual result As above component installs but throws above error and when I look at the files they show similar to above. ### System information (as much as possible) - OS Name & Version: Linus - MySql Version: 5.5.68-MariaDB - Apache Version: nginx/1.20.2 - PHP Version: 7.4.33 - Joomla Version: Joomla! 3.10.11 Stable - JCB Version: 3.1.24 - Browser: Firefox ### Additional comments
Author

I've now tested on other websites on the same server and they work for the admin fields updates. However they are for an earlier version 2.11.4 of JCB so I'm wondering if the latest version of JCB isn't compatible and that's what's giving me the issues

I've now tested on other websites on the same server and they work for the admin fields updates. However they are for an earlier version 2.11.4 of JCB so I'm wondering if the latest version of JCB isn't compatible and that's what's giving me the issues
Author

I ran a clean install on one of the sites on the same server. It threw:

Warning
JInstaller: :Install: Error SQL Specified key was too long; max key length is 767 bytes
Extension Install: SQL error processing query: DB function failed with error number 1071
Specified key was too long; max key length is 767 bytes
SQL =
CREATE TABLE IF NOT EXISTS #__componentbuilder_external_code (
target VARCHAR(255) NOT NULL DEFAULT '',
hash VARCHAR(64) NOT NULL DEFAULT '',
PRIMARY KEY (target)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
Package Install: There was an error installing an extension: joomla__Component-Builder__master.zip

So I wonder if JCB needs a different version of mysql??

I ran a clean install on one of the sites on the same server. It threw: Warning JInstaller: :Install: Error SQL Specified key was too long; max key length is 767 bytes Extension Install: SQL error processing query: DB function failed with error number 1071 Specified key was too long; max key length is 767 bytes SQL = CREATE TABLE IF NOT EXISTS `#__componentbuilder_external_code` ( `target` VARCHAR(255) NOT NULL DEFAULT '', `hash` VARCHAR(64) NOT NULL DEFAULT '', PRIMARY KEY (`target`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; Package Install: There was an error installing an extension: joomla__Component-Builder__master.zip So I wonder if JCB needs a different version of mysql??
Author

So I've created a work around by editing the utilities.php file in the libraries folder.

I updated the get between to cope with and empty value.

public static function getBetween($content, $start, $end, $default = '')
{

    if(!$content){
        $content="";
    }
	return GetHelper::between($content, $start, $end, $default);
}

Hasn't solved my no install properly issue for the component but the admin views work better now.

So I've created a work around by editing the utilities.php file in the libraries folder. I updated the get between to cope with and empty value. public static function getBetween($content, $start, $end, $default = '') { if(!$content){ $content=""; } return GetHelper::between($content, $start, $end, $default); } Hasn't solved my no install properly issue for the component but the admin views work better now.
Owner

I am honestly puzzled by this... this issue has been coming up since we started the migration to Joomla 4 containerized architecture. While it has never happened to me, in my main development environment, nor in any of my test systems, nor with any of the components I have build so far... I have been doing everything I can to try and resolve what I can not see.

What I realize it is the result of using JCB outside of its original use-case (not that JCB should not be stable enough to handle this). But it means I have not build any component with JCB that causes this issue to occurs... or at-least from what I know. Meaning the way I work in JCB does not cause this...

That said... I am going to continue trying to resolve this, as you can look at these past issues:

#994
#978

So some suggestions.

  • Install JCB a few times... lol 😉 don't know why that helps. But its seems to from what I have seen in the other issues...
  • Check that all the new library files are installed
  • Check that all template overriding files found in this folder, that you may have made is removed
  • Read over all the previous issues that are related to this one
  • Try doing some debugging at the point of when the files are being updated, which is over here.
  • Give any more feedback that you discover in the process.

I will stay on the lookout and also respond if I think there is new info worth sharing from my side.

by the way I am truly enjoying working on, and with JCB... sorry to hear about your struggle... but there is light at the end of this tunnel... for sure!!!

I am honestly puzzled by this... this issue has been coming up since we started the migration to Joomla 4 containerized architecture. While it has never happened to me, in my main development environment, nor in any of my test systems, nor with any of the components I have build so far... I have been doing everything I can to try and resolve what I can not see. What I realize it is the result of using JCB outside of its original use-case (not that JCB should not be stable enough to handle this). But it means I have not build any component with JCB that causes this issue to occurs... or at-least from what I know. Meaning the way I work in JCB does not cause this... That said... I am going to continue trying to resolve this, as you can look at these past issues: https://git.vdm.dev/joomla/Component-Builder/issues/994 https://git.vdm.dev/joomla/Component-Builder/issues/978 So some suggestions. - Install JCB a few times... lol 😉 don't know why that helps. But its seems to from what I have seen in the other issues... - Check that all the [new library files](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/libraries/jcb_powers/VDM.Joomla) are installed - Check that all template [overriding files found in this folder](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/admin/compiler/joomla_3), that you may have made is removed - Read over all the previous issues that are related to this one - Try doing some debugging at the point of when the files are being updated, [which is over here](https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/admin/helpers/compiler.php#L381). - Give any more feedback that you discover in the process. I will stay on the lookout and also respond if I think there is new info worth sharing from my side. > by the way I am truly enjoying working on, and with JCB... sorry to hear about your struggle... but there is light at the end of this tunnel... for sure!!!
Owner

@alanwebsites can you please make sure that the plugins are all activated and linked?

Installing JCB now comes with a whole list of plugins, and they must first be activated, and then in the global options under the compiler tab be activated. Not that I think it should be the cause of this issue, but if they are not activated there are some features in JCB that just does not load, and it may be needed.

I have fixed this issue going forward, but existing installs that upgrade will still manually have to do the linking.

@alanwebsites can you please make sure that the plugins are all activated and linked? Installing JCB now comes with a whole list of plugins, and they must first be activated, and then in the global options under the compiler tab be activated. Not that I think it should be the cause of this issue, but if they are not activated there are some features in JCB that just does not load, and it may be needed. I have fixed this issue going forward, but existing installs that upgrade will still manually have to do the linking.
Author

Hi Thanks for the suggestion I checked and they all seem to be published

Content - Componentbuilder Field Ordering Tabs content componentbuilderfieldorderingtabs Public 10453
Content - Componentbuilder Language Tabs content componentbuilderlanguagetabs Public 10454
Content - Componentbuilder Component Dashboard Headers Tabs content componentbuildercomponentdashboardheaderstabs Public 10450
Content - Componentbuilder Component Headers Tabs content componentbuildercomponentheaderstabs Public 10451
Content - Componentbuilder Custom Admin Headers Tabs content componentbuildercustomadminheaderstabs Public 10452
Content - Componentbuilder Dynamic Get Headers Tabs content componentbuilderdynamicgetheaderstabs Public 10457
Content - Componentbuilder Site Headers Tabs content componentbuildersiteheaderstabs Public 10456
Content - Componentbuilder Privacy Tabs content componentbuilderprivacytabs Public 10455
Content - Componentbuilder Admin Headers Tabs content componentbuilderadminheaderstabs Public 10449
Extension - Componentbuilder Privacy Compiler extension componentbuilderprivacycompiler Public 10464
Extension - Componentbuilder Powers Autoloader Compiler extension componentbuilderpowersautoloadercompiler Public 10463
Extension - Componentbuilder ActionLog Compiler extension componentbuilderactionlogcompiler Public 10458
Extension - Componentbuilder Language Packaging extension componentbuilderlanguagepackaging Public 10462
Extension - Componentbuilder Headers Compiler extension componentbuilderheaderscompiler Public 10461
Extension - Componentbuilder Field Ordering Compiler extension componentbuilderfieldorderingcompiler Public 10460
Extension - Componentbuilder Export Compiler

Hi Thanks for the suggestion I checked and they all seem to be published Content - Componentbuilder Field Ordering Tabs content componentbuilderfieldorderingtabs Public 10453 Content - Componentbuilder Language Tabs content componentbuilderlanguagetabs Public 10454 Content - Componentbuilder Component Dashboard Headers Tabs content componentbuildercomponentdashboardheaderstabs Public 10450 Content - Componentbuilder Component Headers Tabs content componentbuildercomponentheaderstabs Public 10451 Content - Componentbuilder Custom Admin Headers Tabs content componentbuildercustomadminheaderstabs Public 10452 Content - Componentbuilder Dynamic Get Headers Tabs content componentbuilderdynamicgetheaderstabs Public 10457 Content - Componentbuilder Site Headers Tabs content componentbuildersiteheaderstabs Public 10456 Content - Componentbuilder Privacy Tabs content componentbuilderprivacytabs Public 10455 Content - Componentbuilder Admin Headers Tabs content componentbuilderadminheaderstabs Public 10449 Extension - Componentbuilder Privacy Compiler extension componentbuilderprivacycompiler Public 10464 Extension - Componentbuilder Powers Autoloader Compiler extension componentbuilderpowersautoloadercompiler Public 10463 Extension - Componentbuilder ActionLog Compiler extension componentbuilderactionlogcompiler Public 10458 Extension - Componentbuilder Language Packaging extension componentbuilderlanguagepackaging Public 10462 Extension - Componentbuilder Headers Compiler extension componentbuilderheaderscompiler Public 10461 Extension - Componentbuilder Field Ordering Compiler extension componentbuilderfieldorderingcompiler Public 10460 Extension - Componentbuilder Export Compiler
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#996
No description provided.