Closed (fixed)
Project:
Canvas Field
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
20 Sep 2016 at 21:26 UTC
Updated:
25 Nov 2016 at 20:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
icicleking commentedI was able to anonymously add canvas field content by allowing anonymous creation of the content type on which the canvas field was placed. /admin/people/permissions
As a caution I'll quote from the module page:
Emphasis mine.
Comment #3
rbayliss commentedThanks for checking, icicleking. parkout, can you give any more details that would help in replicating this issue?
Comment #4
parkout commentedHello, yes i have placed permitions for them. Anonymous users can create a page, but field is empty. If user login it starts work correctly.
What information i can give you to help me solve this problem?
Comment #5
parkout commentedHello! Please need your help. I have understood why empty field. I set field "requaried" and now when anonym draw something and click save he got error "please fill field, it is empty"
Something with encode64 ? very need help!
Comment #6
parkout commentedThe problem still here( Please help
Comment #7
icicleking commentedI was able to recreate this issue.
Desired behavior:
Anonymous users can create a node with a canvas field.
Steps:
NOTE:
The image is uploaded to the `/default/files` directory/
Comment #8
parkout commentedYes! You write all right. No images appear.
And if u check this canvas field 'requared' than u even cant save page, because it get error "empty" field
Comment #9
josephleon commentedFollowed the directions in comment #7 and was able to replicate the issue. I think the issue lies somewhere with the file module and how it handles anonymous users. Devel spits out the same data being passed into the function file_save_data() which is a function in the file module.
Comment #10
josephleon commentedThis patch sets the file status to 1 and also uses the function file_usage_add which creates the link with the file and the module.
https://api.drupal.org/api/drupal/includes%21file.inc/function/file_usag...
Comment #11
josephleon commentedComment #12
josephleon commentedUploading patch created from module instead of root.
Comment #13
josephleon commentedFixed the paths (was still incorrect in #12)
Comment #14
icicleking commentedthe patch works for anonymous users
Comment #15
rbayliss commentedNice find on why this is happening! Looking a little closer, Drupal creates a token for anonymous user uploads, and if that token isn't present for temporary files, it ignores any attempts to save it to a filefield. Rather than creating a file_usage record prematurely (this is supposed to happen later on in file_field_insert()), I think we should just create a token to allow the user to save the file. Patch attached. @icicleking, @josephleon, can you give this a try and make sure it works?
Comment #16
icicleking commented@rbayliss the last patch works as expected.
Comment #18
rbayliss commentedAwesome. Committed and should be available in the latest dev release shortly. Thank you all!