Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Upstream changes v1.0

Johan Janssens edited this page Apr 19, 2017 · 1 revision

Following is a list of changes made to the platform that can potentially be merged back upstream. All changes are 100% backwards and forwards compatible.

Added

JPATH_WEB

define('JPATH_WEB’,       JPATH_ROOT);
com_media/media.php::43
define('COM_MEDIA_BASE',    JPATH_WEB . '/' . $params->get($path, 'images'));

JInstaller::1448 
$destination = JPath::clean(JPATH_WEB . '/media' . $folder);

JHtml::* 
replace JPATH_ROOT with JPATH_WEB

PlgEditorTinymce::*
replace JPATH_ROOT with JPATH_WEB

JHtmlTest::*
replace JPATH_ROOT with JPATH_WEB

JRouterSite::64
$relativeScriptPath = str_replace('\\', '/', str_replace(JPATH_WEB, '', $scriptPath));

JRouterSite::68
if (file_exists(JPATH_WEB . $matches[0]) && ($matches[0] == $relativeScriptPath))

PlgEditorTinymce::106
$templates_path = JPATH_WEB . '/templates’;

MenusModelMenutypes::357
$folders = JFolder::folders(JPATH_WEB . '/templates', '', false, true);

Commit: https://github.com/joomlatools/joomla-platform/commit/cc84a80c4b0356779ab4294534c992ad768c885d

JPATH_LAYOUTS

define('JPATH_LAYOUTS',       JPATH_ROOT . '/lib/layouts');
JLayoutFile::367
$this->addIncludePaths(JPATH_LAYOUTS);

JPATH_APP

Commit: https://github.com/joomlatools/joomla-platform/commit/69be25bc31a418202a66b532780813d389cc755a

JPATH_PLUGINS

JPluginHelper::56

$bPath = JPATH_PLUGINS .'/' . $type . '/' . $name . '/tmpl/' . $defaultLayout . '.php';

JPluginHelper::57 $dPath = JPATH_PLUGINS .'/' . $type . '/' . $name . '/tmpl/default.php';

Register Config

com_config/config.php::20
JLoader::registerPrefix('Config', JPATH_SITE . '/components/com_config');

Check if component is enabled

JHelperMedia::61 -> check if enabled
public function canUpload($file, $component = 'com_media')
{
               
if(JComponentHelper::isEnabled($component))

JToolbarHelper::165
if(JComponentHelper::isEnabled('com_media'))
      {
          
    $bar = JToolbar::getInstance('toolbar');

  // Add an upload button.
          
    $bar->appendButton('Popup', 'upload', $alt, 'index.php?option=com_media&tmpl=component&task=popupUpload&folder=' . $directory, 800, 520);
      
}

Issue : https://github.com/joomlatools/joomla-platform/issues/179

Fixed

Security

  • Session Fixation #253

Bugs

  • JTableAsset::rebuild() fails #203
  • Reference wrong language keys code
  • Fix JArrayHelper not found #142

Performance

  • Do not store the 'mediaVersion' in the database #196
  • Use MyISAM engine for users_sessions table #222

Changed

Error Handling

Set display_errors to 0 when error_reporting is ‘none’. Use display_errors in JErrorPage, when      
generating the error message.

PR : https://github.com/joomlatools/joomla-platform/issues/163

Use JPATH_LIBRARIES

JCrypt::311 
include_once JPATH_LIBRARIES . '/compat/password/lib/password.php';

JStringPuncode::12
JLoader::register('idna_convert', JPATH_LIBRARIES . '/idna_convert/idna_convert.class.php');

build.php::43
require_once JPATH_LIBRARIES .'/cms/version/version.php';

mod_articles_categories.php::15
JLoader::register('JCategoryNode', JPATH_LIBRARIES . '/legacy/categories/categories.php');

JFTP::224
$checkValue = file_get_contents(JPATH_LIBRARIES . '/cms/version/version.php'); 

Use JPATH_ADMINISTRATOR

MenusModelItem::981
$xmlFile = JPath::find(JPATH_ADMINISTRATOR . '/components/com_menus/models/forms', 'item_' . $type . '.xml');

Use JPATH_CONFIGURATION

JApplicationCli::299
if (empty($file) && defined('JPATH_CONFIGURATION'))
{
	$file = JPATH_CONFIGURATION . '/configuration.php';


JApplicationWeb::907
if (empty($file) && defined('JPATH_CONFIGURATION'))
{
	$file = JPATH_CONFIGURATION . '/configuration.php';


JFactory::150
$file = JPATH_CONFIGURATION . '/configuration.php';

Change Editor Path

Change location of the editor to use default media path.

PlgEditorTinymce::25
protected $_basePath = 'media/plg_editors_tinymce';

and others …

Media folder

Cleanup media folder to adhere to standard naming schema. Move /media/media to media/com_media

Removed

$GLOBALS['_PROFILER']

FinderViewSearch::46 
Use JProfiler::getInstance('Application') instead of $GLOBALS['_PROFILER']

Default table prefix

TODO: Rename schemas to extensions_schemas to keep database organised.

Partial Tags implementation

PlgSearchTags::144
require_once JPATH_SITE . '/components/com_tags/helpers/route.php';

Issue : https://github.com/joomlatools/joomla-platform/issues/181

Remove tag id to titles logic JDocumentRendererHead. Unneeded coupling and tags are never set as     
metadata.

Issue : https://github.com/joomlatools/joomla-platform/issues/191

Unused language files

Unused code

Unused language keys

  • COM_CONTENT_LIST_FULL_ORDERING
  • COM_CONTENT_LIST_FULL_ORDERING_DESC

These keys are not defined anywhere in the en-GB language file and not used in the UI.

--

  • COM_CONTENT_LIST_LIMIT
  • COM_CONTENT_LIST_LIMIT_DESC

These keys are not defined anywhere in the en-GB language file and not used in the UI.

Consideration

Other

Debug Plugin Optimisations

To uncouple the debug plugin from the css, the loading of the debug.css should happen in the plugin and the plugin should be injected to the bottom of the page by the plugin instead of being loaded using a module position in the template.

Issue : https://github.com/joomlatools/joomla-platform/issues/261