Skip to content

Commit

Permalink
Fix B/C
Browse files Browse the repository at this point in the history
  • Loading branch information
bembelimen committed Mar 2, 2024
1 parent 36aae5f commit f504178
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Joomla\CMS\Extension\BootableExtensionInterface;
use Joomla\CMS\Extension\MVCComponent;
use Joomla\CMS\Factory;
use Joomla\CMS\Fields\FieldsServiceInterface;
use Joomla\CMS\Fields\FieldsFormServiceInterface;
use Joomla\CMS\Fields\FieldsServiceTrait;
use Joomla\CMS\Form\Form;
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
Expand All @@ -45,7 +45,7 @@
class ContactComponent extends MVCComponent implements
BootableExtensionInterface,
CategoryServiceInterface,
FieldsServiceInterface,
FieldsFormServiceInterface,
SchemaorgServiceInterface,
AssociationServiceInterface,
RouterServiceInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Joomla\CMS\Extension\BootableExtensionInterface;
use Joomla\CMS\Extension\MVCComponent;
use Joomla\CMS\Factory;
use Joomla\CMS\Fields\FieldsServiceInterface;
use Joomla\CMS\Fields\FieldsFormServiceInterface;
use Joomla\CMS\Fields\FieldsServiceTrait;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Helper\ContentHelper as LibraryContentHelper;
Expand Down Expand Up @@ -48,7 +48,7 @@
class ContentComponent extends MVCComponent implements
BootableExtensionInterface,
CategoryServiceInterface,
FieldsServiceInterface,
FieldsFormServiceInterface,
AssociationServiceInterface,
SchemaorgServiceInterface,
WorkflowServiceInterface,
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_fields/src/Model/FieldModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Event\CustomFields\PrepareDomEvent;
use Joomla\CMS\Factory;
use Joomla\CMS\Fields\FieldsServiceInterface;
use Joomla\CMS\Fields\FieldsFormServiceInterface;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Language\Text;
Expand Down Expand Up @@ -1111,7 +1111,7 @@ function () use ($component, $section) {

$componentBooted = Factory::getApplication()->bootComponent($component);

if ($componentBooted instanceof FieldsServiceInterface) {
if ($componentBooted instanceof FieldsFormServiceInterface) {
$componentBooted->prepareForm($form, $data);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Joomla\CMS\Extension\BootableExtensionInterface;
use Joomla\CMS\Extension\MVCComponent;
use Joomla\CMS\Factory;
use Joomla\CMS\Fields\FieldsServiceInterface;
use Joomla\CMS\Fields\FieldsFormServiceInterface;
use Joomla\CMS\Fields\FieldsServiceTrait;
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
use Joomla\Component\Users\Administrator\Service\HTML\Users;
Expand All @@ -30,7 +30,7 @@
*
* @since 4.0.0
*/
class UsersComponent extends MVCComponent implements BootableExtensionInterface, RouterServiceInterface, FieldsServiceInterface
class UsersComponent extends MVCComponent implements BootableExtensionInterface, RouterServiceInterface, FieldsFormServiceInterface
{
use FieldsServiceTrait;
use RouterServiceTrait;
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Extension/LegacyComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Joomla\CMS\Component\Router\RouterServiceInterface;
use Joomla\CMS\Dispatcher\DispatcherInterface;
use Joomla\CMS\Dispatcher\LegacyComponentDispatcher;
use Joomla\CMS\Fields\FieldsServiceInterface;
use Joomla\CMS\Fields\FieldsFormServiceInterface;
use Joomla\CMS\Fields\FieldsServiceTrait;
use Joomla\CMS\Menu\AbstractMenu;
use Joomla\CMS\MVC\Factory\LegacyFactory;
Expand All @@ -42,7 +42,7 @@ class LegacyComponent implements
ComponentInterface,
MVCFactoryServiceInterface,
CategoryServiceInterface,
FieldsServiceInterface,
FieldsFormServiceInterface,
RouterServiceInterface,
TagServiceInterface
{
Expand Down
36 changes: 36 additions & 0 deletions libraries/src/Fields/FieldsFormServiceInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/**
* Joomla! Content Management System
*
* @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\CMS\Fields;

use Joomla\CMS\Form\Form;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* The fields service.
*
* @since __DEPLOY_VERSION__
*/
interface FieldsFormServiceInterface extends FieldsServiceInterface
{
/**
* Prepares the field form
*
* @param Form $form The form to change
* @param array|object $data The form data
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function prepareForm(Form $form, $data);
}
12 changes: 0 additions & 12 deletions libraries/src/Fields/FieldsServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,4 @@ public function validateSection($section, $item = null);
* @since 4.0.0
*/
public function getContexts(): array;

/**
* Prepares the field form
*
* @param Form $form The form to change
* @param array|object $data The form data
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function prepareForm(Form $form, $data);
}

0 comments on commit f504178

Please sign in to comment.