1
Development and Code Review / Re: Need Advice: Managing Configuration Files
« on: May 12, 2024, 12:33:11 pm »
I don't need to do that. There are group files with names containing uninterrupted numbering starting from 1. The number of these groups is stored in the global configuration file. The initial issue is that you can't simply delete a random group file and decrement the value in the global config by one, as it will disrupt the sequence of group file names, causing a service error. Ideally, we need to restore the sequence by automatically resaving the entries with the restored sequence in numbering. I don't know how to do this properly because I haven't seen such solutions in other plugins, and I'm not fully proficient in PHP. Therefore, I've decided to temporarily bypass this issue by disallowing the deletion of configs.
p.s.
Thank you for your help! I've simplified things significantly. In the view, I've restricted deletion of all entries except the last one. As a result, the sequence remains intact, and it's permitted to delete group entries, but only from the end of the list.
p.s.
Thank you for your help! I've simplified things significantly. In the view, I've restricted deletion of all entries except the last one. As a result, the sequence remains intact, and it's permitted to delete group entries, but only from the end of the list.