ElkArte Community

Elk Development => Bug Reports => Topic started by: ahrasis on February 11, 2019, 01:58:29 am

Title: Profile Show Drafts errors
Post by: ahrasis on February 11, 2019, 01:58:29 am
Login > Forum > Your Profile > Show Drafts

Mine shows errors in Attachments.subs.php and Attachment.controller.php files due to some undefined. I cannot confirm it as a bug yet since it could may be because of my tenancy own addons.

The cause is said to be "Undefined variable: id_topic" in Attachment.controller.php lines 347 and 352.

Anybody get this error may however help confirm this as a bug. Thanks.
Title: Re: Profile Show Drafts errors
Post by: emanuele on February 11, 2019, 01:19:12 pm
hmm... are attachments saved for drafts? I forgot... :-[
If so, then it could be the preview that tries to show the attachment and fails because a draft doesn't have a $topic attached.
Title: Re: Profile Show Drafts errors
Post by: radu81 on February 11, 2019, 05:17:48 pm
If you try to save a post with attachments as drafts you get a message:
QuoteThis will save the text of your post, but it will not save attachments, poll or event information.
 
 

Title: Re: Profile Show Drafts errors
Post by: ahrasis on February 11, 2019, 05:57:56 pm
Quote from: emanuele – hmm... are attachments saved for drafts? I forgot... :-[
If so, then it could be the preview that tries to show the attachment and fails because a draft doesn't have a $topic attached.

Yes. There is attachment(s) in some of the drafts. So, this is common? Is it considered a bug and/or need fixing?
Title: Re: Profile Show Drafts errors
Post by: emanuele on February 13, 2019, 04:08:24 pm
Bug indeed, just not sure what is actually broken.
Well, okay, it is broken Attachment.controller.php at lines 347 and 352.
Since attachments are not saved for drafts, then it should just bail out sometimes before reaching the point. At the moment I'm not sure where, though.
Title: Re: Profile Show Drafts errors
Post by: badmonkey on February 13, 2019, 06:22:11 pm
Would it be desirable to save attachments in drafts? If not, why? 
Title: Re: Profile Show Drafts errors
Post by: ahrasis on February 14, 2019, 04:54:42 am
I prefer not. May be just replace it with its file name and make a note somewhere that draft feature does not save any attachments while the draft is saved. Does this make any sense?
Title: Re: Profile Show Drafts errors
Post by: emanuele on February 14, 2019, 05:55:19 am
IIRC drafts should be able to save attachments in 2.0, unless I may have dreamed about having it, not sure honestly... fairly confused... lol
Title: Re: Profile Show Drafts errors
Post by: ahrasis on March 27, 2019, 09:39:18 am
I don't think this one is tracked yet for 1.1.6.
Title: Re: Profile Show Drafts errors
Post by: Spuds on April 01, 2019, 02:11:26 pm
Tracked here: https://github.com/elkarte/Elkarte/issues/3294

I think for 1.1 we "supress" the error and wait for 2.0 to consider saving of attachments in drafts.