Images not showing up in wiki...

Re: Images not showing up in wiki...

by Mike Churchward -
Number of replies: 13
Picture of Core developers Picture of Plugin developers Picture of Testers
Hello -

I'm looking into this problem today, but I can't duplicate everything I read here. To start, let me explain the way some of this works:

There are a few ways to insert images into a wiki. Two that are discussed here are through the Moodle file system and through the wiki upload function.

The Moodle image insert works via the HTML editor. If you use it, any images you upload go into the course file directory (or any subdirectory you specify when you upload it). This function insert an HTML image tag pointing to the specified file. This is not wiki code, but rather HTML code contained in the wiki.

The other method is through the Wiki attachment function. If you upload an image from the wiki upload function at the bottom of the wiki edit screen, you are creating a wiki attachment. This file can be accessed within the wiki using a wiki internal link (e.g. '[internal://image.jpg]'). When you upload a file using this method, it is uploaded to the wiki ativity's directory within the course directory (moodledatadir/courseid/moddata/wiki/modid/userid/pagename). An image, however, is stored directly into the database tables. To insert the image within the wiki page use an internal tag within square brackets as so: [internal://imagename.jpg].

The problem I'm having is that these both work for me. I have noticed a stange error page appearing with an image upload, but it seems to be incorrect - that is, there is no error.

Is there a particular type of image that fails? I've been using jpegs.

mike
In reply to Mike Churchward

Re: Images not showing up in wiki...

by Michael Richardson -
Hi Mike,

Thanks for looking into this.

After reading your message, I tried the image insert via the HTML editor again. It now seems to work flawlessly for me, also.

Perhaps some tiny bug quietly crept out of the Wiki code during subsequent upgrades since this thread began. smile

I'm currently using: Moodle 1.4.2 (2004083125).

Thanks, and Happy Thanksgiving Day (perhaps not too germane outside the U.S.)!

Cheers,

MIke Richardson
UW Radiology
In reply to Michael Richardson

Re: Images not showing up in wiki...

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Hmmm.

It could be. I upgraded my site before looking into the problem, so it could be that something fixed it.

mike
In reply to Mike Churchward

Re: Images not showing up in wiki...

by Art Lader -

The image upload utility in wysisyg editor is now working for me, too. smile

You, too, Tomo?

-- Art

In reply to Art Lader

Re: Images not showing up in wiki...

by Tomokazu Switzer -

Yay!  It's working!  The upgrade fixed it!

Tomo

In reply to Tomokazu Switzer

Re: Images not showing up in wiki...

by Art Lader -

> Yay!  It's working! 
> The upgrade fixed it!

Life is so sweet in Moodleville. smile

-- Art

In reply to Art Lader

Re: Images not showing up in wiki...

by Tomokazu Switzer -
Grr.. spoke too soon.  It worked for one, but not the rest.  However, I goofed something up when I updated my Moodle and that could be part of the problem as well.  I'll have to reinstall Moodle.
In reply to Mike Churchward

Images not showing up in attachments tab

by Dmitry Pupinin -
Picture of Core developers Picture of Plugin developers

The other method is through the Wiki attachment function … When you upload a file using this method, it is uploaded to the wiki ativity's directory within the course directory (moodledatadir/courseid/moddata/wiki/modid/userid/pagename).

This not completely faithfully … If you upload an image from the wiki upload function at the bottom of the wiki edit screen it is place file at moodledatadir/courseid/moddata/wiki/modid/userid (not in pagename directory). In consequence of which file is not displayed at attachments tab, but it is shown in wiki. Same can be made by upload file from attachments tab but choosing main in Upload in combobox (select).

What is main? Why files in main not showing in attachments tab? How delete files from wiki (AND FROM MAIN TOO)?

In reply to Dmitry Pupinin

Re: Images not showing up in attachments tab

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Hi Dmitry -

When I upload an image using this method it is stored as a binary object in the database, and not stored as a file at all. You don't see this behaviour?

mike
In reply to Mike Churchward

Re: Images not showing up in attachments tab

by Dmitry Pupinin -
Picture of Core developers Picture of Plugin developers

I see that file is saved in any way to moodledatadir/courseid/moddata/wiki/modid/userid! And most important - image is displayed only if file present in that directory!

Why need save the files in database? They not visible to user automaticaly. Never display what and how many files have been uploaded. Ouch! In History can see links to images, but it is mess, MESS!!! That situation may only confuse user! Also in database is not stored who upload file (only his IP). No possibility to delete files.

Why need inline? Using attachments is most intuitive!

In reply to Dmitry Pupinin

Re: Images not showing up in attachments tab

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
That's very strange indeed. The image is definitely not saved to a directory on my installation, and exists in the 'content' field of the 'wiki_pages' table only. This is only for images. All other attachments have an associated file.

We'll have to figure out where in the code it decides to do this.

As to your other questions, the reasons these things are done are because that's the way the ewiki code that this is based on did it. Not necessarily a good reason, or the right decision.

I think we will have to go through the wiki code and standardize the way this is done. Once Moodle has a fully integrated DMS, it would make sense for it to use that system. It also gets a little messier when dealing with group or individual wikis.

I'm not sure what you mean by, "Why need inline? Using attachments is most intuitive!".

mike
In reply to Mike Churchward

Re: Images not showing up in attachments tab

by Dmitry Pupinin -
Picture of Core developers Picture of Plugin developers

I use 2004083125 version of Wiki at 1.4.2+ Moodle and also version of Moodle and modules from CVS.

'Content' field of the 'wiki_pages' table have NULL for each record of image (marked inline in meta field or not). This is database's records of two image. First of it upload as attachment, second as databaseinside:

    <mdl_wiki_pages>
        <pagename>internal://madewithmoodle.gif</pagename>
        <version>1</version>
        <flags>18</flags>
        <author>Главный Администратор (localhost 127.0.0.1:1511)</author>
        <userid>1</userid>
        <created>1101758651</created>
        <lastmodified>1101758651</lastmodified>
        <meta>a:12:{s:5:"class";s:5:"image";s:12:"Content-Type";s:9:"image/gif";s:6:"Pragma";s:5:"cache";s:14:"X-Content-Type";s:9:"image/gif";s:16:"Content-Location";s:18:"madewithmoodle.gif";s:19:"Content-Disposition";s:41:"attachment; filename="madewithmoodle.gif"";s:7:"section";s:10:"First Wiki";s:7:"comment";s:16:"Made with Moodle";s:4:"size";i:683;s:12:"binary_store";s:10:"First Wiki";s:5:"width";i:130;s:6:"height";i:19;}</meta>
        <hits>6</hits>
        <wiki>5</wiki>
    </mdl_wiki_pages>
    <mdl_wiki_pages>
        <pagename>internal://moodlelogo.gif</pagename>
        <version>1</version>
        <flags>18</flags>
        <author>localhost 127.0.0.1:1478</author>
        <userid>1</userid>
        <created>1101758399</created>
        <lastmodified>1101758399</lastmodified>
        <meta>a:9:{s:5:"class";s:5:"image";s:12:"Content-Type";s:9:"image/gif";s:6:"Pragma";s:5:"cache";s:16:"Content-Location";s:14:"moodlelogo.gif";s:19:"Content-Disposition";s:33:"inline; filename="moodlelogo.gif"";s:4:"size";i:2617;s:12:"binary_store";N;s:5:"width";i:100;s:6:"height";i:30;}</meta>
        <hits>7</hits>
        <wiki>5</wiki>
    </mdl_wiki_pages>

This is only for images. All other attachments have an associated file. Files of other types not possible upload from bottom of Edit page! It is generate error "Inaccessible format of file".

In reply to Dmitry Pupinin

Re: Images not showing up in attachments tab

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Okay. It appears that images over a certain size (not sure what size yet), are loaded into the database rather than as a file. I tried with a 24K and a 700K jpeg. The 700K jpeg went into the database and the 24K was uploaded.

The reason there are different locations for these files has to do with the function used.

If you 'attach' an image to a wiki (using the attachments tab) you are adding that image as a piece of that wiki page. Therefore it is uploaded to the specific wiki page sibdirectory that it is part of.

If you upload an image from the edit page using the wiki function (not the editor function), you are creating an upload to the entire wiki (not just the page). Therefore, it is uploaded to the wiki subdirectory rather than the page subdirectory. This is not an attachment but rather a conceptual separate wiki page (that can be referred to).

mike
In reply to Mike Churchward

Re: Images not showing up in attachments tab

by Dmitry Pupinin -
Picture of Core developers Picture of Plugin developers
I think that work with ALL files must be in attachment tab (this much obviously for user)!!!
But need to let user to choose how he want upload file (into the database or not). This centralizes work with files in one place!