← Back to team overview

dhis2-devs team mailing list archive

Re: Deleting Data Elements do not work

 

Jason,

I'm aware of the sort_order issue, so I'm using that string of sql queries
to identify WHICH reports and charts that contain the specific data element
/ indicator - then I modify the objects the normal way (in the UI) before
attempting (in the UI) to delete the data element / indicator again.

I agree 100% that the deletion handler should deal with this, or as you say
at least give more detailed and thus usable feedback on why it fails.

I'll see if there is a blue-print on this.

Regards
Calle

On 4 December 2015 at 11:04, Jason Pickering <jason.p.pickering@xxxxxxxxx>
wrote:

> Hi Calle,
> You should probably be very careful about the removal of the favorites. As
> Lars pointed out to me some time ago, the "sort_order" column in certain
> database tables (like chart_datadimensionitems) form a set. When one of
> these is deleted by hand, it will result in a null pointer exception when
> the favorite is loaded again. The fundamental problem is that the deletion
> handler is not able to resolve this situation. I wrote some SQL to deal
> with the removal of organisatoin units (
> https://github.com/dhis2/dhis2-utils/blob/master/resources/sql/delete_site_with_data.sql)
> and I think this could be pretty easily adapted to your use case, and may
> be better than trying to delete things by hand. Ultimately though I think,
> the deletion handler should be able to deal with this (or at the very
> least, inform you which favorites are causing the deletion to fail), but
> its something which is potentially very destructive, and should not be done
> that frequently, so maybe an SQL script is a better option just to be sure
> that major chaos does not ensue when a data element is deleted by mistake.
>
> Best regards,
> Jason
>
>
> On Fri, Dec 4, 2015 at 9:41 AM, Calle Hedberg <calle.hedberg@xxxxxxxxx>
> wrote:
>
>> Hi,
>>
>> OK, I just found out that the "Prevent this page from creating additional
>> dialogs" came back when re-starting Chrome. What I still do not understand
>> is that ticking that option actually disabled the REMOVE option completely
>> (as in no longer working).
>>
>> I got no problem with blocking the removal of data elements with DATA, by
>> the way, but removals are also blocked if a data element is used in any
>> kind of report or chart. And the system does not tell you WHICH report (it
>> just refers to object ReportTable), so I end up having to track it through
>> datadimensionitems etc in the database itself to identify which reports or
>> charts are affected (there are a few hundred favourites in the instance),
>> then modify those, then go back, try to delete again, now being told it
>> cannot because it's linked to to objects of type Chart, etc.
>>
>> Is there a simpler way in UI to determine WHICH reports and charts that
>> contain a specific data element or indicator? Or even better, a simpler way
>> to remove a specific data element or indicator from all charts and reports
>> using them?
>>
>> Regards
>> Calle
>>
>>
>>
>>
>>
>> On 4 December 2015 at 09:41, Lars Helge Øverland <larshelge@xxxxxxxxx>
>> wrote:
>>
>>> Hi Calle,
>>>
>>> assuming your are using Chrome. This is a browser feature. The option is
>>> "Prevent this page from creating additional dialogs" to prevent misbehaving
>>> web sites. It it enough to close the browser and open it again.
>>>
>>> Lars
>>>
>>>
>>> On Fri, Dec 4, 2015 at 8:00 AM, Olav Poppe <olav.poppe@xxxxxx> wrote:
>>>
>>>> Hi,
>>>> regarding the popup, I think that is a browser (Chrome and possibly
>>>> others) feature - if there are multiple similar(?) popups, it will ask you
>>>> if you want to ignore all. I though this was only a one-time thing and that
>>>> they would not disappear permanently, but not sure about this.
>>>>
>>>> Olav
>>>>
>>>>
>>>> 4. des. 2015 kl. 06.21 skrev Jason Pickering <
>>>> jason.p.pickering@xxxxxxxxx>:
>>>>
>>>> Hi Calle,
>>>>
>>>> This is the important part "the data element cannot be deleted because
>>>> it's linked to this or that object."
>>>>
>>>> The deletion handler cannot delete data elements if the data element is
>>>> linked to certain objects which is cannot handle deleting, like if the data
>>>> element is linked to data. The data would need to be deleted, followed by
>>>> the data element.
>>>>
>>>> Also, I am not really sure about the popup. There is nothing which I
>>>> can see which can turn this off. Are you sure this is not some sort of
>>>> popup blocker on your browser?
>>>>
>>>> Regards,
>>>> Jason
>>>>
>>>>
>>>> On Thu, Dec 3, 2015 at 8:30 PM, Calle Hedberg <calle.hedberg@xxxxxxxxx>
>>>> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> I've been deleting a number of data elements using the normal user
>>>>> interface - since the confirmation popup every time was a bit annoying, I
>>>>> clicked the "do not show this again" (or whatever the popup tick-box was
>>>>> called).
>>>>>
>>>>> The confirmation popup has disappeared - and I cannot see any
>>>>> reference in the user manual to how to get it back - but more importantly
>>>>> the deleting no longer works. No messages, no "deleting....", not even any
>>>>> error messages that the data element cannot be deleted because it's linked
>>>>> to this or that object.
>>>>>
>>>>> Is this a bug?
>>>>>
>>>>> How do I turn the confirmation popup back on, since it's seems to be
>>>>> compulsory for it to work?
>>>>>
>>>>> Regards
>>>>> Calle
>>>>>
>>>>> *******************************************
>>>>>
>>>>> Calle Hedberg
>>>>>
>>>>> 46D Alma Road, 7700 Rosebank, SOUTH AFRICA
>>>>>
>>>>> Tel/fax (home): +27-21-685-6472
>>>>>
>>>>> Cell: +27-82-853-5352
>>>>>
>>>>> Iridium SatPhone: +8816-315-19119
>>>>>
>>>>> Email: calle.hedberg@xxxxxxxxx
>>>>>
>>>>> Skype: calle_hedberg
>>>>>
>>>>> *******************************************
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Mailing list: https://launchpad.net/~dhis2-devs
>>>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>>>> More help   : https://help.launchpad.net/ListHelp
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Jason P. Pickering
>>>> email: jason.p.pickering@xxxxxxxxx
>>>> tel:+46764147049 <+46764147049>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~dhis2-devs
>>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~dhis2-devs
>>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>
>>>
>>> --
>>> Lars Helge Øverland
>>> Lead developer, DHIS 2
>>> University of Oslo
>>> Skype: larshelgeoverland
>>> http://www.dhis2.org <https://www.dhis2.org>
>>>
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>>
>> --
>>
>> *******************************************
>>
>> Calle Hedberg
>>
>> 46D Alma Road, 7700 Rosebank, SOUTH AFRICA
>>
>> Tel/fax (home): +27-21-685-6472
>>
>> Cell: +27-82-853-5352
>>
>> Iridium SatPhone: +8816-315-19119
>>
>> Email: calle.hedberg@xxxxxxxxx
>>
>> Skype: calle_hedberg
>>
>> *******************************************
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Jason P. Pickering
> email: jason.p.pickering@xxxxxxxxx
> tel:+46764147049
>



-- 

*******************************************

Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@xxxxxxxxx

Skype: calle_hedberg

*******************************************

References