Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Form control fields, new API #43857

Merged
merged 10 commits into from
Oct 16, 2024
Merged

Conversation

Fedik
Copy link
Member

@Fedik Fedik commented Jul 28, 2024

Summary of Changes

Replace control inputs hardcoded into the form layout with an API which allows to add this fields programaticaly.

Before PR (the form layout):

<input type="hidden" name="task" value="">
<input type="hidden" name="return" value="<?php echo $input->getBase64('return'); ?>">
<input type="hidden" name="forcedLanguage" value="<?php echo $input->get('forcedLanguage', '', 'cmd'); ?>">
<?php echo HTMLHelper::_('form.token'); ?>

After PR:

// In Controller/View
$this->form
  ->addControlField('task', '')
  ->addControlField('return', $input->getBase64('return', ''))
  ->addControlField('forcedLanguage', $forcedLanguage);

// In the form layout
echo $this->form->renderControlFields();

For now I have updated following forms:

  • Article
  • Category
  • Menu

Will update more, when there will be a positive feedbacks.

Testing Instructions

Code review.
Create/edit Article, Category, Menu item. All should work as before.

Actual result BEFORE applying this Pull Request

Works

Expected result AFTER applying this Pull Request

Works

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org: Form control fields new feature Manual#322
  • No documentation changes for manual.joomla.org needed

@Fedik Fedik added the Feature label Jul 28, 2024
@Fedik Fedik changed the title [5.x] Form control fields [5.x] Form control fields, new API Jul 28, 2024
@Frostholm7
Copy link

I have tested this item ✅ successfully on 5cfe985

A long life in IT, I have learned that everything changes.
A wise controller, from Italy, whom I once met, said that we should remember that we did not invent solutions to problems that we did not have! Extra testing, modifying working code, and so on.

The code does as described, it is as such ok.

I miss a use case for this change. What is it that is being tried to solve?
It could just be that I just haven't seen it.


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

@Frostholm7
Copy link

PS. testet on
Wampserver install version 3.3.2 installed on 2024-04-03
Updated to 3.3.6 on 2024-08-04
MySQL 8.2.0 Port 3306
Apache 2.4.62
PHP 8.3.10
error_reporting = E_ALL
Display Errors = on

With

2024-08-09
5.2 dev
a9980fe


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

@Frostholm7
Copy link

version a9980fe


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

@Frostholm7
Copy link

It's weird that my text disappears or gets changed.


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

libraries/src/Form/Form.php Outdated Show resolved Hide resolved
Co-authored-by: Quy <quy@nomonkeybiz.com>
@superd0ll
Copy link

I have tested this item ✅ successfully on c24da87

Tested successfully


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

@exlemor
Copy link

exlemor commented Aug 24, 2024

I have tested this item ✅ successfully on c24da87

I was able to test successfully :)


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

@richard67
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 24, 2024
@HLeithner HLeithner changed the base branch from 5.2-dev to 5.3-dev September 2, 2024 08:50
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.3-dev.

@HLeithner HLeithner changed the title [5.x] Form control fields, new API [5.3] Form control fields, new API Sep 2, 2024
@Hackwar Hackwar removed the PR-5.2-dev label Sep 3, 2024
@HLeithner HLeithner merged commit b9820f1 into joomla:5.3-dev Oct 16, 2024
4 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Oct 16, 2024
@HLeithner
Copy link
Member

thanks, first step for form renderer

@Quy Quy added this to the Joomla! 5.3.0 milestone Oct 16, 2024
@Fedik Fedik deleted the form-control-fields branch October 16, 2024 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants