Moodle

ORA-01704: content of a wiki page is too long, when trying to save

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.7, 1.7.1, 1.7.2, 1.8
  • Fix Version/s: 1.7.3, 1.8.3, 1.9
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Environment:
    Solaris 10,
    Oracle 10g
  • Database:
    Oracle
  • URL:
    /mod/wiki/view.php...
  • Affected Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

Description

Someone wanted to save a really long wiki page and got only [[errorsaving]] as error-message (its from within ewiki.php)
The following ORA error message is thrown, when developer messages are on:

ORA-04098: trigger 'ORA_MONITOR.ALERT_TR_ERRORS' is invalid and failed re-validation ORA-01704: string literal too long

INSERT INTO m_wiki_pages ( PAGENAME, VERSION, FLAGS, CONTENT, AUTHOR, USERID, CREATED, LASTMODIFIED, REFS, META, HITS, WIKI ) VALUES ( 'Übungsaufgabe 2.1 - Antwort', 4, 1, '
.......
here comes the really huge content text of the wiki page...approximately 3900 characters
.......
', 'dednis drotger (123.134.62.153:2362)', 3, 1177657076, 1178630599, ' Sozialversicherungsbeiträge Sozialbeiträge Prioritäten Einschränkung Ausbildungsplätzen Universität Tertiärbereich ', '', 106, 312 );

Do you have to use a special variable for this INSERT
or is the (clob,4000) column for "content" too short?!

Activity

Hide
D P added a comment -

maybe this helps...

www.oracle.com/technology/pub/articles/oracle_php_cookbook/fuecks_lobs.html

Show
D P added a comment - maybe this helps... www.oracle.com/technology/pub/articles/oracle_php_cookbook/fuecks_lobs.html
Hide
D P added a comment -

Okay, that was tough...(where are you, Eloy?!)

At line 126 of /mod/wiki/ewikimoodlelib.php

  1. change args-array to object...
    $wikidennis = new object();
    foreach ($args as $index => $value) {
    error_log("[ewikimoodlelib]: index: $index and value: $value");
    $wikidennis->$index = $value;
    }
  1. Write
    $result=insert_record(EWIKI_DB_TABLE_NAME,$wikidennis,false);
Show
D P added a comment - Okay, that was tough...(where are you, Eloy?!) At line 126 of /mod/wiki/ewikimoodlelib.php
  1. change args-array to object... $wikidennis = new object(); foreach ($args as $index => $value) { error_log("[ewikimoodlelib]: index: $index and value: $value"); $wikidennis->$index = $value; }
  1. Write $result=insert_record(EWIKI_DB_TABLE_NAME,$wikidennis,false);
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Dennis,

at first step I've added some checks both in insert_record() and update_record() to detect, fix and debug about records passed as arrays (18_STABLE and HEAD).

Now I'm going to apply your code from 17_STABLE to HEAD... Thanks!

Show
Eloy Lafuente (stronk7) added a comment - Hi Dennis, at first step I've added some checks both in insert_record() and update_record() to detect, fix and debug about records passed as arrays (18_STABLE and HEAD). Now I'm going to apply your code from 17_STABLE to HEAD... Thanks!
Hide
Eloy Lafuente (stronk7) added a comment -

Should be working now (1.7, 1.8 and 1.9). Closing. Thanks!

P.S.: Instead of iterating over the array, I've used one simpler cast to object.

Show
Eloy Lafuente (stronk7) added a comment - Should be working now (1.7, 1.8 and 1.9). Closing. Thanks! P.S.: Instead of iterating over the array, I've used one simpler cast to object.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: