? Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
10 Jan 2022

Create a console plugin that boot the com_content component and run it from terminal

ie. something like

$content = Factory::getApplication()->bootComponent('com_content')->getMVCFactory();
$model = $content->createModel('Article', 'Administrator',['ignore_request' => true]);
$result = $model->save($article);

Summary of Changes

  • added the getUserState() method to the ConsoleApplication.php
  • don't check session from cli
  • early return from Webauthn plugin when from console

Testing Instructions

Actual result BEFORE applying this Pull Request

image

Expected result AFTER applying this Pull Request

no error in console and article created

References

#36568, #36332, #35818

cc: @wilsonge @laoneo @anibalsanchez

avatar alikon alikon - open - 10 Jan 2022
avatar alikon alikon - change - 10 Jan 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jan 2022
Category Libraries Front End Plugins
avatar alikon alikon - change - 10 Jan 2022
The description was changed
avatar alikon alikon - edited - 10 Jan 2022
avatar alikon alikon - change - 10 Jan 2022
The description was changed
avatar alikon alikon - edited - 10 Jan 2022
avatar wilsonge
wilsonge - comment - 10 Jan 2022

Ok so webauthn looks fine. But where else is the user state being used - i don't particularly like having to implement that in the consoleapplication class

avatar alikon
alikon - comment - 10 Jan 2022

the main point is we want the console app like 1st citizen ?
we want the console application able to re-use existing CMS code or not ?

i've shared the plugin console code already maybe i've made something wrong there ??
https://github.com/alikon/testcom/blob/main/plugins/console/lorem/src/Extension/LoremIpsumCommand.php

avatar laoneo
laoneo - comment - 10 Jan 2022

If you have 'ignore_request' => true then the populateState function should not be called. On other places the userstate should not be called.

avatar wilsonge
wilsonge - comment - 10 Jan 2022

I don't have the ability to test right now - I'll give it a test when I get home but @laoneo is right about the theory of how this should work

avatar alikon
alikon - comment - 10 Jan 2022

as you can see i already have set ['ignore_request' => true]

$content = Factory::getApplication()->bootComponent('com_content')->getMVCFactory();
$model = $content->createModel('Article', 'Administrator',['ignore_request' => true]);
$result = $model->save($article);
avatar laoneo
laoneo - comment - 10 Jan 2022

And where is the user state requested?

avatar alikon
alikon - comment - 10 Jan 2022

even then the setUserState() is not a method of ConsoleApplication what i'm missing ?

avatar chmst chmst - change - 31 Jan 2022
Labels Added: ?
avatar alikon alikon - change - 6 Feb 2022
Labels Added: ?
Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 13 Feb 2022
Category Libraries Front End Plugins Front End Plugins
avatar joomla-cms-bot joomla-cms-bot - change - 13 Feb 2022
Category Front End Plugins Administration com_content Front End Plugins
avatar alikon alikon - change - 13 Feb 2022
The description was changed
avatar alikon alikon - edited - 13 Feb 2022
0f33dc1 13 Feb 2022 avatar alikon cs
avatar alikon
alikon - comment - 14 Feb 2022

let's see what kind of thumb i'll collect cc: @SharkyKZ

avatar alikon
alikon - comment - 21 Mar 2022

closed by mistake i suppose

avatar alikon alikon - reopen - 21 Mar 2022
avatar alikon alikon - change - 25 May 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-05-25 11:49:10
Closed_By alikon
avatar alikon alikon - close - 25 May 2022

Add a Comment

Login with GitHub to post a comment