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

[4.0] Add Controller suffix to extension controllers #17624

Merged
merged 5 commits into from
Aug 24, 2017

Conversation

laoneo
Copy link
Member

@laoneo laoneo commented Aug 19, 2017

Summary of Changes

This are the controller changes to give the component MVC classes more meaningful names. Controllers will have now Controller as suffix to their class name. So Joomla\Component\Banners\Administrator\Controller\Banners becomes Joomla\Component\Banners\Administrator\Controller\BannersController.

Additionally the default controller which is called just Controller gets the name DisplayController, to better reflect whet the class does.

Testing Instructions

  • Create a banner in the back end
  • Create an article in the back end

Expected result

All is working as expected.

Actual result

All is working as expected.

Documentation Changes Required

If there is already documentation written for the namespaced controllers, then it needs to be updated.

@laoneo laoneo changed the title Add Controller suffix to extension controllers [4.0] Add Controller suffix to extension controllers Aug 22, 2017
@laoneo laoneo closed this Aug 23, 2017
@laoneo laoneo deleted the controller-restructure branch August 23, 2017 05:54
@laoneo laoneo restored the controller-restructure branch August 23, 2017 06:55
@laoneo
Copy link
Member Author

laoneo commented Aug 23, 2017

Accidentally deleted branch. Thanks reflog!!

@@ -93,12 +93,13 @@ public function __construct($config = array(), MvcFactoryInterface $factory = nu
{
$r = null;

if (!preg_match('/(.*)Controller(.*)/i', get_class($this), $r))
if (!preg_match('/(.*)Controller\\\\(.*)/i', get_class($this), $r))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to break non-namespaced controllers

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, will fix it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it, tested it with web links and it worked

$controllerClass = $namespace . $client . '\\Controller\\' . ucfirst($name);
}

// @todo Remove me when core extensions are converted
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just do this now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to make it reviewable. But I will change them after the merge.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And first, #17682 needs to get it, otherwise I git tons of merge conflicts

@wilsonge wilsonge merged commit 70a6e43 into joomla:4.0-dev Aug 24, 2017
@wilsonge wilsonge deleted the controller-restructure branch August 24, 2017 10:51
@wilsonge wilsonge added this to the Joomla 4.0 milestone Aug 24, 2017
roland-d added a commit to roland-d/joomla-cms that referenced this pull request Aug 31, 2017
…olandd-4.0-dev

* '4.0-dev' of https://github.com/joomla/joomla-cms: (35 commits)
  Delete redis handler in favor of fw handler (joomla#17798)
  Remove deprecated JArrayHelper (joomla#17795)
  [4.0] codestyle (joomla#17779)
  Update error renderers for PHP 7 code structure, update Exception/Throwable references to only reference Throwable (joomla#17750)
  Improve article association links
  Fix parsing routes with language filter enabled
  Fix JString use
  [4.0] Fix content margin if no "top" modules are assigned (joomla#17699)
  Removed required state for Secret Key field (joomla#17713)
  [4.0] [installation]  set proper default for lastResetTime (joomla#16847)
  [4.0] Remove FOF From Joomla Core (joomla#17687)
  [4.0] Add Controller suffix to extension controllers (joomla#17624)
  Fix menu association form field not loading
  remove html imports (joomla#17691)
  [4.0] Update Bootstrap to beta-1 (joomla#17496)
  Move files
  [4.0] Cleanup classmap and include it properly for stubs generation (joomla#17667)
  Add back class that got deleted somewhere
  Fix Sql field class name (joomla#17666)
  [4.0] Fix namespaced form fields Part 2 (joomla#17664)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants