Open betterapp opened 2 years ago
$params['context']['resource']['file']
contains the used import source. This can be a folder, a glob expression, a single file or a URL etc.
If you want to know from which file a certain raw data item came from, please add a raw data field __source
Here is a quote from the documentation:
You can specify a folder path as import source instead of a single file. In this case files in this folder (and subfolders) are imported subsequently (sorted by modification time - oldest first). Already imported files are stored in an
archive
folder within the import folder.In addition to the source file fields you can use the field
__source
to obtain the source file name. This can be useful if you want to process the source file name in the object import (e.g. to call a dependent import with the same import file).
there was a change in 3.0 about this ? In 2.8.5 under 'file' was full path with file name.
Yes, I think so. Previously the resolved source file was listed there. But this is not correct because when you import data from several files in a folder $params['context']['resource']['file']
cannot always contain the same file.
How can I access to __source from Result Callback Function ??
there is no __source under $params['context'] and below
This is a normal raw data field then. You can access it via $params['rawItemData']['__source']['value']
.
I checked it allready - it is NULL
We use wildcard here:
And I check the value like this:
if ($params['lastCall']) {
var_dump($params['rawItemData']['__source']['value']); die;
}
Oh, __source
did not work for Excel-based dataports. Is fixed in 3.0.10.
is it released with tag or still in development ?
Is already released.
In 2.8.5 under $params['context']['resource']['file']
has full path to asset with file name.
In 3.0.6 there is only full path WITHOUT file name.
Why ?