Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 10 2020 14:22
    cundd closed #61
  • Dec 10 2020 14:22
    cundd commented #61
  • Dec 10 2020 14:22
    cundd closed #65
  • Dec 10 2020 14:22
    cundd commented #65
  • Dec 09 2020 11:29
    cundd commented #66
  • Dec 09 2020 11:27
    cundd closed #66
  • Dec 09 2020 11:27

    cundd on v4

    [BUGFIX] Allow autodetected lan… [BUGFIX] Allow autodetected lan… Merge branch 'v4' of https://gi… and 1 more (compare)

  • Dec 08 2020 15:19
    Travis cundd/rest (berndbrot-v4) passed (638)
  • Dec 08 2020 15:16
    Travis cundd/rest (berndbrot-v4) passed (638)
  • Dec 08 2020 14:47
    Travis cundd/rest (berndbrot-v4) passed (638)
  • Dec 08 2020 14:47
    Travis cundd/rest (berndbrot-v4) passed (638)
  • Dec 08 2020 14:45
    Travis cundd/rest (berndbrot-v4) passed (638)
  • Dec 08 2020 14:42
    Travis cundd/rest (berndbrot-v4) passed (638)
  • Dec 08 2020 14:15
    Travis cundd/rest (berndbrot-v4) passed (638)
  • Dec 08 2020 13:38
    Travis cundd/rest (v4) passed (637)
  • Dec 08 2020 13:13
    Travis cundd/rest (v4) passed (637)
  • Dec 08 2020 13:12
    Travis cundd/rest (v4) passed (637)
  • Dec 08 2020 13:12
    Travis cundd/rest (v4) passed (637)
  • Dec 08 2020 13:12
    Travis cundd/rest (v4) passed (637)
  • Dec 08 2020 12:49
    Travis cundd/rest (v4) passed (637)
Daniel Corn
@cundd
And do you see that configuration in the TypoScript Object Browser?
Markus
@eckonator
yes
Daniel Corn
@cundd
Hmm. Did you enter the TS in the backend? If it is inside an extension TS it unfortunately may be overwritten by the default TS
Markus
@eckonator
Problem solved. After moving the typoscript setup into the new file ext_typoscript_setup.txt from my provider-extension, it works now fine.
Daniel Corn
@cundd
:+1:
yeah. thats something I have to improve somewhen
Markus
@eckonator
Hi @cundd, new day, new problems. I started to customize my extension and copied the handler from the custom_rest Extension to build my own handler. First try was to show my Exbase listView Data as Json. But the object from my view is alwas empty. Can you help me?
Daniel Corn
@cundd
Are you calling an Extbase action from the handler, is that correct?
Markus
@eckonator
yep
at first i get a json error
than i wrapped a json_decode() to my return data - then i got am empty message: {}
Daniel Corn
@cundd
What was the error you got?
Markus
@eckonator
if i use the default handler from rest (CrudHanlder.php) all items are shown well
would we look together in a private teamviewer session? Are you speaking german, too?
Daniel Corn
@cundd
I speak german, but I prefer english here
Maybe you could try to use the Extractor to encode your data into JSON
and I json_encode() would be necessary to convert the data into JSON (not json_decode())
Markus
@eckonator
    # curl -X GET https://ws.qfox.de/rest/ecki-eckivisitorscreen-visitor
    $router->add(
        Route::get(
            '/ecki-eckivisitorscreen-visitor/?',
            function (RestRequestInterface $request) {
                return json_decode($this->helper->callExtbasePlugin(
                    'Visitor',
                    'Ecki',
                    'Eckivisitorscreen',
                    'Visitor',
                    'list',
                    []
                ));
            }
        )
    );
thats my first try

Maybe you could try to use the Extractor to encode your data into JSON

have you an example for me for using the extractor?

Daniel Corn
@cundd
What happens if you omit json_decode()?

have you an example for me for using the extractor?

The default DataProvider uses the extractor: https://github.com/cundd/rest/blob/v5/Classes/DataProvider/DataProvider.php#L77

Markus
@eckonator

What happens if you omit json_decode()?

than i get: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

it returns the fluid template with it's html-tags
Daniel Corn
@cundd
ah ok
Markus
@eckonator
no, should i copy my existing controller to have an specifiv json output controller?
Daniel Corn
@cundd
Maybe. Or create a subclass of it with the $defaultViewObjectName overwritten
I guess that should work too
Markus
@eckonator
now i get "null"
Daniel Corn
@cundd
hmm. Try to make a var_dump of $this->helper->callExtbasePlugin(...)
Markus
@eckonator
Problem solved. My findAll function returned an Object, but it must be an array to show the data.
Daniel Corn
@cundd
:+1:
Markus
@eckonator
i have overritten my findAll function in my repository like this
/**
 * Find all downloads with storage or all
 *
 * @param bool $respectStorage
 * @param bool $asArray
 * @return array|QueryResultInterface|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
 */
public function findAll($respectStorage = true, $asArray = false)
{
    $query = $this->createQuery();

    if (!$respectStorage) {
        $query->getQuerySettings()->setRespectStoragePage(false);
    }

    return $query->execute($asArray);
}
Daniel Corn
@cundd
The Extractor was also designed to take care of this
Markus
@eckonator
now, i can set in my findAll Function to respectStorge or asArray
Daniel Corn
@cundd
That's great :)
Markus
@eckonator
Hi @cundd i using now the default CrudHanlder.php and want to add a new entry over the rest api. Everythink works fine, online one problem: The model contains a MM-DataRelation to another Model. How to pass this relation throw the rest api?
actuel example:
{"date":1611147600,"visitor":"Herr Max Muster","company":"Musterfirma GmbH","screenlocations":[],"uid":101,"pid":15}
i tried this, but no luck:
{"date":1611147600,"visitor":"Herr Max Muster","company":"Musterfirma GmbH","screenlocations":["screenlocation": "Screen1"],"uid":101,"pid":15}
Daniel Corn
@cundd
Hi @eckonator That's a difficult task...
It all boils down to whether the data you send can be translated correctly by Extbase.
Daniel Corn
@cundd
I would build a subclass of the CrudHandler and manage the relations there
One important question is: Do you need to create the foreign model too, or do you just need to create the relation?
Markus
@eckonator
I need only to build the relation. I think i have a easy solution for this.
Daniel Corn
@cundd
:+1:
It also may work somehow with the special __identity property