joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

Publishing tab still shows

Open Webdongle opened this issue 1 year ago • 29 comments

Steps to reproduce the issue

In Article Options >>> Editing Layout (tab) ...Publishing options Hide Login front end as Super User (or as as user with 'Edit State')

Expected result

The 'Publishing' tab does not show

Actual result

The 'Publishing' tab shows but the 'Metadata' tab does not show

System information (as much as possible)

Additional comments

Webdongle avatar Sep 20 '24 09:09 Webdongle

@Webdongle #37816 related?

Maybe the Option mean "Hide some options but not the tab" and i misunderstand.

yes

Originally posted by @brianteeman in https://github.com/joomla/joomla-cms/issues/37816#issuecomment-1148266526

ghost avatar Sep 20 '24 10:09 ghost

Yes I see that reasoning. However the 'Publish' field should also be hidden with the 'Start Publishing' etc.?

Also the Options field could read 'Hide publishing Options' rather than 'Hide Publishing tab'?

Perhaps close in favour of https://github.com/joomla/joomla-cms/issues/37816 ?

Webdongle avatar Sep 20 '24 12:09 Webdongle

Can you check if there is a difference here between j4 and j5

brianteeman avatar Sep 20 '24 13:09 brianteeman

J3.4.4.8 Hide set SHOW fe edit 01

J3.4.4.8 Hide set HIDE fe edit 02

Webdongle avatar Sep 20 '24 14:09 Webdongle

@Webdongle

Can you check if there is a difference here between j4 and j5

brianteeman avatar Sep 20 '24 14:09 brianteeman

Doesn't look like any difference to me. Have a look at the screenshots please. Does that look the same as J5 to you?

Webdongle avatar Sep 20 '24 15:09 Webdongle

Your screenshots are both for j4

brianteeman avatar Sep 20 '24 15:09 brianteeman

Yes and when I compare them to J5 they look the same. When you have J5 up and compare them to the J4 screenshots do they look the same to you?

Webdongle avatar Sep 20 '24 20:09 Webdongle

Can reproduce in J5 as well

Pinkeltje avatar Sep 26 '24 09:09 Pinkeltje

What needs to be done here? I read the other closed PRs and guess its a naming issue.

Instead of the Option to Show or Hide "Publishing Options" maybe "Publishing Date fields" ? And why is Metadata hidden with it, should that be added as extra option or should the condition be removed?

coolcat-creations avatar Oct 11 '24 06:10 coolcat-creations

Not a programmer but I think this solves the problem in "components\com_content\tmpl\form\edit.php" from line 100

             <?php if ($params->get('show_publishing_options', 1) == 1) : ?>

        <?php echo HTMLHelper::_('uitab.addTab', $this->tab_name, 'publishing', Text::_('COM_CONTENT_PUBLISHING')); ?>

            <?php echo $this->form->renderField('transition'); ?>
            <?php echo $this->form->renderField('state'); ?>
            <?php echo $this->form->renderField('catid'); ?>
            <?php echo $this->form->renderField('tags'); ?>
            <?php echo $this->form->renderField('note'); ?>
            <?php if ($params->get('save_history', 0)) : ?>
                <?php echo $this->form->renderField('version_note'); ?>
            <?php endif; ?>
            <?php if ($params->get('show_publishing_options', 1) == 1) : ?>
                <?php echo $this->form->renderField('created_by_alias'); ?>
            <?php endif; ?>
            <?php if ($this->item->params->get('access-change')) : ?>
                <?php echo $this->form->renderField('featured'); ?>
                <?php if ($params->get('show_publishing_options', 1) == 1) : ?>
                    <?php echo $this->form->renderField('featured_up'); ?>
                    <?php echo $this->form->renderField('featured_down'); ?>
                    <?php echo $this->form->renderField('publish_up'); ?>
                    <?php echo $this->form->renderField('publish_down'); ?>
                <?php endif; ?>
            <?php endif; ?>
            <?php echo $this->form->renderField('access'); ?>
            <?php if (is_null($this->item->id)) : ?>
                <div class="control-group">
                    <div class="control-label">
                    </div>
                    <div class="controls">
                        <?php echo Text::_('COM_CONTENT_ORDERING'); ?>
                    </div>
                </div>
            <?php endif; ?>
        <?php echo HTMLHelper::_('uitab.endTab'); ?>
`

Pinkeltje avatar Oct 11 '24 08:10 Pinkeltje

Yes I know, that's what I am asking if there was any reason putting it in the condition. and what needs to be done, then I create a PR

coolcat-creations avatar Oct 11 '24 08:10 coolcat-creations

@coolcat-creations : Edited my previous contribution. Think this solves it. Image Image

Pinkeltje avatar Oct 11 '24 08:10 Pinkeltje

Just found out that when doing this, one is unable to select category (which is located in publishing tab. Maybe it can be solved by changing line 57 to

                <?php echo $this->form->renderField('articletext'); ?>
                  <?php if ($params->get('show_publishing_options', 1) == 0) : ?>
                  <?php echo $this->form->renderField('catid'); ?>
   <?php endif; ?>

Pinkeltje avatar Oct 11 '24 12:10 Pinkeltje

Where did you set the param, @Webdongle? I cannot find any param for for the frontend. show_publishing_options is meant as param for the backend, but for some reason it is used in the edit screen on frontend.

I would see this as a bug in frontend edit screen.

Image

chmst avatar Oct 13 '24 18:10 chmst

@chmst where is that text from? I would say that the text is wrong for both publishing and article options and that text and its use of the word TAB are what is causing the confusion. For me everything is working exactly as it was designed

brianteeman avatar Oct 13 '24 19:10 brianteeman

@brianteeman That is from the help page for Article options

@chmst When the option is show then on the front end the frontend edit screen shows more options on the Publishing tab (the header that says 'Publishing'). And the Metadata tab (the header that says 'Publishing') is seen When the option is Hide then on the front end the frontend edit screen shows less options on the Publishing tab (the header that says 'Publishing'). And the Metadata tab (the header that says 'Publishing') is NOT seen.

@brianteeman Says that is as expected.

So if that is the way it is supposed to work then we have to work with it and hope someone can update the help docs.

Spot the difference

Set Show Image

Set Hide Image

Addendum I edited the docs page https://docs.joomla.org/Help5.x:Articles:_Options but the help page https://help.joomla.org/proxy?keyref=Help52:Articles:_Options hasn't updated

Webdongle avatar Oct 14 '24 01:10 Webdongle

Should we just clean up these options a bit and add options for frontend and backend and make everything more clear?

coolcat-creations avatar Oct 14 '24 05:10 coolcat-creations

I have prepared a PR with a re-arrangement of fields and tabs. Will commit when I am back on my laptop.

But I disagree with changing the docs. All these switches are only for backend and it is not consistent that one of them is for backend and frontend, the others are not. We should have eihter a switch for Show_published on frontend (like for images) or show always all fields.

What we have now is not consistent from usability point of view

chmst avatar Oct 14 '24 06:10 chmst

But I disagree with changing the docs. All these switches are only for backend

But the Help screen says the switch is for admin when the switch actually alters fields and removes a whole tab from the edit screen in the front end.

Perhaps the questions should be: Why is the layout of front edit screen different to the admin edit screen (except of course for the Permissions tab) and Why does the switch have different affects on the front edit screen than it does the admin side.

Webdongle avatar Oct 14 '24 09:10 Webdongle

Perhaps the questions should be: Why is the layout of front edit screen different to the admin edit screen (except of course for the Permissions tab) and Why does the switch have different affects on the front edit screen than it does the admin side.

This is the question, but I have no answer. Please test the PR #44246 if this is convenient.

chmst avatar Oct 14 '24 10:10 chmst

the help screen is simply wrong. the code is correct

brianteeman avatar Oct 14 '24 10:10 brianteeman

If the code is correct, then the help screen is wrong. The question is, IF the code is correct.

Fact is, that the edit screen is confusing, because general article options and publishing Option are mixed in one tab.

chmst avatar Oct 14 '24 11:10 chmst

I do not understand why you have the featured field in one tab but Start Featured and Finish Featured in a different tab

Webdongle avatar Oct 14 '24 12:10 Webdongle

If the code is correct, then the help screen is wrong. The question is, IF the code is correct.

Check the history of the code. That gives you the answer

brianteeman avatar Oct 14 '24 14:10 brianteeman

I stop here. Who wants can test the PR or make an aternative PR and who wants can contine this useless discussion.

chmst avatar Oct 14 '24 14:10 chmst

Where is the PR @chmst :-)

coolcat-creations avatar Oct 14 '24 14:10 coolcat-creations

https://github.com/joomla/joomla-cms/pull/44246

chmst avatar Oct 14 '24 14:10 chmst

thank you :-)

coolcat-creations avatar Oct 14 '24 14:10 coolcat-creations

I close this for now, https://github.com/joomla/joomla-cms/pull/44246 resolves the issue.

chmst avatar Dec 15 '24 12:12 chmst