Extension talk:PageVariable

Jump to navigation Jump to search

About this board

Does #getv parse templates at the target page before looking for variables?

1
NBarto (talkcontribs)

"You can use the function within templates to store parsed template data items for later re-use."

Does that mean #getv parses templates at PAGENAME, including any #setv, before looking for VARIABLENAME?

Reply to "Does #getv parse templates at the target page before looking for variables?"

utf8 for the database table

1
90.46.107.252 (talkcontribs)

I was a bit bothered that using the SQL code as provided in the extension, it created an ascii table. Also it used a different database format from the one mediawiki is using for most other tables.

To align with the utf8 format of all the other databases of my installation, I used the following formula (you'll need to change coetus_coetus.csmw_ in whatever is the right prefix for your database).

 CREATE TABLE coetus_coetus.csmw_pagevariable_data (
  pgv_entity VARCHAR(255) NOT NULL,
  pgv_attribute VARCHAR(255) NOT NULL,
  pgv_value TEXT
 ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
Reply to "utf8 for the database table"

Issue fixed on database prefix

1
90.46.107.252 (talkcontribs)

My mediawiki database is prefixed coetus_coetus.csmw

When I created the table as coetus_coetus.pagevariable_data, the write & delete functions of this extension requested for the table to be called coetus_coetus.csmw_pagevariable_data and I changed the table name to fit their need.

But the setv function wants to read from coetus_coetus.pagevariable_data , i.e. not from the same database. When I dupplicate coetus_coetus.csmw_pagevariable_data into coetus_coetus.pagevariable_data, the reading works fine, but the new writings or alterations of values of variables are not read.

I'm using currently mediawiki version 1.20.2 Cleary, with my installation, the write database and the read database don't manage prefixes identically.

It seems I could correct the issue by just amending a single line of the code within my own implementation : I changed (in getv function)

$query = "select distinct pgv_value from pagevariable_data where pgv_entity = '$entity' and pgv_attribute='$attribute'";

into

$query = "select distinct pgv_value from csmw_pagevariable_data where pgv_entity = '$entity' and pgv_attribute='$attribute'";
Reply to "Issue fixed on database prefix"
There are no older topics