• denisprogrammer

    (@denisprogrammer)


    My name is Denis Botic (full-stack WP programmer) and I’ve found a bug that I would like to report. If you write a text in activity form => whats-new textarea element and you upload the media file, you will notice that previously written text will disappear. This is not the proper way of how this should function.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter denisprogrammer

    (@denisprogrammer)

    Here is the solution.

    ///////////////////////////////////////////////////////////////////////////////////////////////////////
    // Disable the original line of code responsible for clearing the text field after media file uploaded
    ///////////////////////////////////////////////////////////////////////////////////////////////////////  
    
        Buddykit.js
    
              FilesAdded: function(up, files) {
                $('#buddykit-filelist-wrap').show();
    
                // Filter maximum number of downloads.
                if ( buddyKitFiles.length >= __buddyKit.config.options.buddykit_field_max_image_number ) {
                  alert('You have reached the allowed number of images per post.');
                } else {
                  plupload.each( files,
                    function(file) {
                      document.getElementById(__buddyKit.file_list_container_id ).innerHTML += '<li id="'+file.id+'" class="buddykit-filelist-item">' + ' (' + plupload.formatSize(file.size) + ') <b></b></div>';
                    });
                    ////////////////////////////////////////////////////////////////////
                    // It is not neccesary to clear text area after media file uploaded.
                    // Therefore I've disabled the line of code below.
                    // $('#whats-new').focus().val('').selectRange(0,0);
                    ////////////////////////////////////////////////////////////////////
                  uploader.start();
                }
              },
    Thread Starter denisprogrammer

    (@denisprogrammer)

    ///////////////////////////////////////////////////////////////////////////////////////////////////////
    // My upgrade for displaying errors - actual error will be displayed in console
    ///////////////////////////////////////////////////////////////////////////////////////////////////////  
    
        Buddykit.js
    
        ///////////////////////////////////////////////////////////////////////////////
        // My upgrade for displaying errors - actual error will be displayed in console
        //////////////////////////////////////////////////////////////////////////////
        file_el.innerHTML += '<li id="'+file_id+'" class="buddykit-filelist-item error"><span>Server Error<br> try again later</span></div>';
        console.log("Media file upload error: " + err.message);
        // I've disabled original line of code below, responsible for displaying actual errors in user interface
        // file_el.innerHTML += '<li id="'+file_id+'" class="buddykit-filelist-item error"><span>'+err.message+'</span></div>';
        /////////////////////////////////////////////////////////////////////////////
    Thread Starter denisprogrammer

    (@denisprogrammer)

    I’ve contributed on github…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Reporting Bug – text content cleared after media file uploaded’ is closed to new replies.