J4 Issue ? ?
avatar hgh-esn
hgh-esn
16 May 2019

Hi to all developers of joomla,
I'm trying to build a new feature for Joomla 4x, because I'm missing a note-field for plugins. I'v done it in my J3.9.6 Installation as a core-hack. There I use the isis-template. Doku see -> https://moba-hgh.de/joomla

When setting up this in my Joomla! 4.0.0-alpha9-dev environment, all works, but I get a little bug in the plugins formview. The note-field is inserted twice in the right area. -> see the formview-picturescreen shot 2019-05-16 at 04 17 20

The green frame is the right place and the red frame is the bug !
I can't find any place, where the bug is generated. Please can anybody help.

When I get it to run, I will make a standard feature-request via github.

Greetings from germany
HGH

Steps to reproduce the issue

Expected result

Actual result

System information (as much as possible)

Additional comments

screen shot 2019-05-16 at 04 17 24

avatar hgh-esn hgh-esn - open - 16 May 2019
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 May 2019
avatar hgh-esn hgh-esn - change - 16 May 2019
The description was changed
Title
New Feature: Notes for plugins
New Feature: a note-field for plugins
avatar hgh-esn hgh-esn - change - 16 May 2019
The description was changed
avatar hgh-esn hgh-esn - edited - 16 May 2019
avatar hgh-esn hgh-esn - change - 16 May 2019
The description was changed
avatar hgh-esn hgh-esn - edited - 16 May 2019
avatar hgh-esn hgh-esn - change - 16 May 2019
The description was changed
avatar hgh-esn hgh-esn - edited - 16 May 2019
avatar hgh-esn hgh-esn - change - 16 May 2019
Title
New Feature: a note-field for plugins
[4.0] New Feature: a note-field for plugins
avatar hgh-esn hgh-esn - edited - 16 May 2019
avatar hgh-esn hgh-esn - change - 16 May 2019
Title
[4.0] New Feature: a note-field for plugins
[4.0] New Feature / Backend: a note-field for plugins
avatar hgh-esn hgh-esn - edited - 16 May 2019
avatar hgh-esn hgh-esn - change - 16 May 2019
The description was changed
avatar hgh-esn hgh-esn - edited - 16 May 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 May 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 16 May 2019
avatar ghazal
ghazal - comment - 16 May 2019

Nice idea.
It would be useful since tooltips have been removed from admin.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24920.

avatar franz-wohlkoenig franz-wohlkoenig - change - 16 May 2019
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 May 2019
Labels Added: ?
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 16 May 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 May 2019
Title
[4.0] New Feature / Backend: a note-field for plugins
[4.0] Backend: a note-field for plugins
avatar franz-wohlkoenig franz-wohlkoenig - edited - 16 May 2019
avatar brianteeman
brianteeman - comment - 16 May 2019

Impossible to guess without seeing the code

avatar ReLater
ReLater - comment - 16 May 2019

@hgh-esn
By the way: I've read your 3.9-documentation that you've linked to in your first comment. Are you aware that fields system_data and custom_data are removed from table #__extensions in Joomla 4?
See further discussion here: #19348
The discussion/the issue is still open if the related PRs shall be reverted but...

avatar ReLater
ReLater - comment - 16 May 2019

@ghazal

It would be useful since tooltips have been removed from admin.

I don't see the connection with this issue. And old hover tooltips for descriptions will be replaced by another solution as far as I know.

avatar hgh-esn
hgh-esn - comment - 16 May 2019

@ReLater

Are you aware that fields system_data and custom_data are removed from table #__extensions in Joomla 4?

... yes I am - and was surprised about that. But in my J4-patch I have created a new field named "note" in #__extensions. So it should be not a problem.

The only problem that I have at the moment is the duplicate display of the note-field in the formview. If this is cleared I will make all necessary steps to get it into the core.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24920.

avatar ghazal
ghazal - comment - 16 May 2019

@ReLater
In j3.X, there is some much useful information in those "old hover tooltips". I really hope devs developing j4 extensions will get the drift, ie their removal.
So, I assumed that any additional information, wherever it is, would be welcomed.

avatar hgh-esn
hgh-esn - comment - 16 May 2019

@ReLater, @brian

here comes a screenshot from the file, that - for me - produces the messing code.
j4-com_plugins_tmpl_plugin_edit php

the original file is: .../administrator/components/com_plugins/tmpl/plugin/edit.php

The green framed area is code, I putted in.

When I comment out the code in the red frame, the issue isn't there - but also the fields "Status" and "Access" are missing ;).
So I think the issue comes from the "LayoutHelper::render('joomla.edit.global', $this)" statement.

avatar hgh-esn
hgh-esn - comment - 17 May 2019

This morning I inspected the code around 'joomla.edit.global'
(we find it in: ".../layouts/joomla/edit/global.php") ;)

`<?php
/**

  • @Package Joomla.Site
  • @subpackage Layout
  • @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
  • @license GNU General Public License version 2 or later; see LICENSE.txt
    */

defined('JPATH_BASE') or die;

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Multilanguage;

$app = Factory::getApplication();
$form = $displayData->getForm();
$input = $app->input;
$component = $input->getCmd('option', 'com_content');

if ($component === 'com_categories')
{
$extension = $input->getCmd('extension', 'com_content');
$parts = explode('.', $extension);
$component = $parts[0];
}

$saveHistory = ComponentHelper::getParams($component)->get('save_history', 0);

$fields = $displayData->get('fields') ?: array(
'transition',
array('parent', 'parent_id'),
array('published', 'state', 'enabled'),
array('category', 'catid'),
'featured',
'sticky',
'access',
'id',
'language',
'tags',
'note',
'version_note',
);
...`
When I comment out the 'note' field, my problem is solved.

My decision is to build in a code-switch as:
If ($component !== 'com_plugins' { .... do that above } else { ... do that above without the fields 'note', 'version_note' }

In first tests it runs perfect. 👍

avatar ReLater
ReLater - comment - 17 May 2019

do that above without the fields 'note', 'version_note'

You don't have to exclude 'version_note' because this field doesn't exist in plugins. No "automatic" output will happen then.

What I would do:

  • Leave the note field where it is without changing the JLayout file. Remove your custom green output block for note. Create a pr with the basic changes and wait for comments if somebody doesn't want the field where it automatically is. That's one of the reasons why we are on GitHub. You can change and adjust your pr stepwise. The first step is that it works and others can test the functionality.
  • or (I think that should work too but haven't checked it): Populate $displayData['fields'} before the JLayout is called.
  • or create an override for JLayout /layouts/joomla/edit/global.php only for com_plugins.

Again: That's what I would do (starting with the first solution) but I don't have to decide that.

avatar hgh-esn
hgh-esn - comment - 20 May 2019

Hi to all,

at the moment, I'm gathering all informations together to make a branch later.
But I have some questions.

The feature needs a new field named "note" in the db-table "#__extensions".
In my test-environment I used phpMyAdmin to create the field via an ALTER table command.

In Joomla, this field must be created on installation. Therefore I have identified a file "joomla.sql" in the folders

../installation/sql/mysql/ and ../installation/sql/postgresql/

Questions:

Database:

  1. What is the difference-usage for those two folders?
  2. Are that the areas, where to define the sql for db-tables for full-installations?
  3. Where are the areas, when using an Joomla-update-package?

Languages:
I have to setup 2 language-keys for the note-field.
This entries must be in the language-folder/-file: /administrator/language/en-GB/en-GB.com_plugins.ini

How is the process to get the international-translation?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24920.

avatar ReLater
ReLater - comment - 20 May 2019

What is the difference-usage for those two folders?

One is for mysql databases the other one for postgresql databases. Both can be used in Joomla.

Are that the areas, where to define the sql for db-tables for full-installations?

Yes.

Where are the areas, when using an Joomla-update-package?

administrator/components/com_admin/sql/updates/

How is the process to get the international-translation?

"Automatically". Your pr gets a "Language Change" label. You don't have to do more. Just en-GB.*.ini

avatar joomla-cms-bot joomla-cms-bot - change - 20 May 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-05-20 20:04:32
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 20 May 2019
avatar Quy Quy - change - 20 May 2019
Closed_By joomla-cms-bot Quy
avatar joomla-cms-bot
joomla-cms-bot - comment - 20 May 2019

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/24920

avatar Quy
Quy - comment - 20 May 2019

See PR #24966


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24920.

Add a Comment

Login with GitHub to post a comment