TYPO3 how remove file with references - typo3

I have TYPO3 7.6.18.
I have MyVendor\Extension\Domain\Model\FileReference Object
So tell me please how to delete this file? I need delete file, and rows from sys_file and sys_file_reference tables. Help me please, anybody!

You can use the API to delete the file. All references will be cleaned automatically.
$file->getStorage()->deleteFile($file);

You first need to remove the file from all records where it is used, then you can delete the file. The info action on the file will give you a list of all usages.

Related

DSpace 6 - Custom Metadata Field

In DSpace 6.3, when I try to export metadata in a particular collection where .csv file will be downloaded in that file how could I add a custom field or column of fulltextpdf column or Name of the file column where can I modify to get this column.
I have attached the .csv file, So please guide me to solution to add a custom column in the metadata.
When I export the metadata so that I could get all the fields including added column.
Thanks & Regards
Sai Kumar S
I have attached the .csv file, So please guide me to solution to add a custom column in the metadata.
When I export the metadata so that I could get all the fields including added column.
[enter image description here][1]
[1]: https://i.stack.imgur.com/KLlne.png

How to duplicate a report?

I am trying to duplicate a report that already exists already with the exact formatting.
I don't see an option to duplicate or copy a report.
Save a copy (File->Save As) with a new name, or save in a new location with the same name.

SSTable folder naming convention

I just noticed that my newly created sstable folder has a combination of numbers and letters attached. For my table "tweets" it looks like:
/var/lib/cassandra/data/twitter/tweets-a6da23906d8211e8a057ffb9a095df5c
on the disk. Does anybody know what this attached hash is?
Thanks!
Christian
The folder name consists of table name, and table ID that is generated anew every time when the table is created - this is done to prevent race condition when table created, dropped, created, etc.

TYPO3: How to check if a record is new or just a copy

I implemented two hooks (processDatamap_afterDatabaseOperations and processDatamap_postProcessFieldArray) to manipulate any record after saving.
My Question is:
Every time I copy or create a record I enter the hooks and get a parameter "status" which is always "new" no matter if the record is actually new or just a copy of an existing record.
It seems like TYPO3 handles copies as new records.
How can I check if a record is actually a copy or a new record?
I am currently working with TYPO3 Version 8.7.9.
You can use the t3_origuid.
It should be added to your extbase domain model.
See here.
After handling the "copy" command the id of the original record will be copied into this field.
So in the hooks:
processDatamap_preProcessFieldArray or processDatamap_postProcessFieldArray you can access to it.
Like:
if(isset($fieldArray['t3_origuid']) {
<your_code>
}

how to add new Fields into solr schema

I am doing data import from Mongo to Solr. For this I need to add new fields into the Solr schema. I am using solr server 5.1.0.
Schema.xml is not available in solrhome/server/solr/core/config directory so I copied one from solr-5.1.0\server\solr\configsets\basic_configs\conf to core\config and added fields into this.
Now when we start Solr server I get WARN message that I should remove the schema.xml file as this is now managed-schema. These fields should be moved to managed-schema file, but this didn't happen.
How Solr will move the database table to indexing. Does it convert each row into a document? Or I have to specify document structure somewhere?
How I can re index the data previously imported?
For Data import you need db-data-config.xml file where you will put your sql queries and configure it with SOLR For information about how to achieve the configuration go to this link
I have find a way to add the fields into schema. Please provide your input if there is any other proper way of doing it.
1. add schema.xml file into your solr/core1/conf directory.
2. copy all content of managed-schema into schema.xml
3. add the new fields into schema.xml.
4. delete the managed-schema.xml
5. restart the solr it will create a managed-schema.xml and will move schema.xml to scheam.bkp
References-
solrconfig.xml - Read the doc for schemaFactory tag.