Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesGetting Deleted Date from ModuleInfo (moving module to recycle bin) Getting Deleted Date from ModuleInfo (moving module to recycle bin)
Previous
 
Next
New Post
6/22/2017 10:32 AM
 
Hi,
I am programatically trying to list all the modules that have been deleted in DNN 8.0.3.
I tried get the information from event log after enabling "Tab module deleted " but the information would be lost when some one clears the log.
So I cannot relay on the log to get this details.
So I am trying to create my own logic.

I am using this function to get all modules in the site.
DotNetNuke.Entities.Modules.ModuleController.Instance.GetAllModules().Cast<ModuleInfo>()
I am able to check if the module is deleted using the IsDeleted property.
I find that the Last modified date and last modified by user is not getting updated when a module is deleted.

Is there any way to check the datetime  when the module was deleted and the user who deleted the module?

 

Thanks in advance 

 

 
New Post
7/3/2017 9:03 PM
 

Phil,

The IsDeleted attribute is a 'soft' delete.  It doesn't detect if a module has been discarded.

The Last Modified On date will detect when the package was changed.  I just put a module on a page and then deleted it to see what would happen in Modules.  Since the Created On and Modified On mean just that, not Deleted On, the Modules table won't record that history.

I know of one way you could get the info you need.  It's involved SQL writing but should work.  The last time I did anything with this was in Advanced TSQL classes some time back.

There are tables that record what transactions have happened when there are updates, deletions, additions to tables in TSQL.  This is where you would have to get the information, I think.  The reference is TSQL Fundamentals by Itzik Ben Gan.  My copy is for SQL Server 2008.  Because what was done with the data once committed, rolled back, etc. is recorded in transaction logs, you should be able to get the data there.

If I recall right, you'd have to go through backups, if you have them and compare them.  That is, get a date range of what happened when and if you have full and incremental backups in that time frame you *should* be able to get what was deleted, updated, added from Modules and Module Definitions from the transaction logs.  This is how a restore can happen -- the logs are a record of exactly what happened and when.

If the logs don't exist there isn't a way you could do this.

My answer is a bit vague, I know.  I just tried to find in the book where this was but could not.

-- Update, found this on Google: https://logicalread.com/sql-server-dbcc-log-command-tl01/#.WVqxnYjyuiM.  This will get you on the right road but TAKE HEED to the warning -- executing the function dbLog with production data is at your own risk.  There are exercises in Itzik's books that you can get up to speed on against test data instances.  You'd have to monitor tables like Tabs, Tab Modules, Modules, Module Definitions, etc. to track what's happened and when.

My word to the wise -- fly anything you're going to do by a DBA and get their blessings first.

Wish I could help more.

Best,

Mike Durthaler

 
New Post
7/23/2017 2:24 PM
 
the easiest option should be adding an after update/delete trigger to the tabmodules table, which writes into a custom log table.

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesGetting Deleted Date from ModuleInfo (moving module to recycle bin) Getting Deleted Date from ModuleInfo (moving module to recycle bin)


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.

Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out