Project

General

Profile

Actions

Feature #17275

closed

Virtual fields

Added by Nikolas Hagelstein over 17 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2007-05-04
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

3rd party tables usually do not own typo3 specific fields or equivalent columns.
So i would be nice to have a virtual field feature. E.g. prepend pid to typo3 to make
3rd party records appear on a certain sysfolder.

(issue imported from #M5563)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #22096: Where clause 0=0 cannot be parsedClosedXavier Perseguers2010-02-09

Actions
Actions #1

Updated by Xavier Perseguers almost 15 years ago

Hi,

Quite old feature request but... :-)

I'm able to show records from a MSSQL database with legacy tables that have nothing to do with TYPO3 (no uid, pid, or other columns). I did this:

- Created a tca.php with some fields of my 'Members' table
- Created a ext_tables.php
- Mapped pid to '1' (sysfolder/page with uid = 1) and uid columns to my primary key ('MemberID')

Configuration looks like that:

$TYPO3_CONF_VARS['EXTCONF']['dbal']['mapping'] = array(
'Members' => array(
'mapFieldNames' => array(
'pid' => '1',
'uid' => 'MemberID',
),
),
);

tca.php looks like that:

$TCA['Members'] = array(
'ctrl' => $TCA['Members']['ctrl'],
'interface' => array(
'showRecordFieldList' => 'firstname,lastname,email'
),
'feInterface' => $TCA['Members']['feInterface'],
'columns' => array(
'firstname' => array(
'exclude' => 0,
'label' => First Name',
'config' => array(
'type' => 'input',
'size' => '20',
'max' => '20',
'eval' => 'required,trim',
)
),
'lastname' => array(
'exclude' => 0,
'label' => 'Last Name',
'config' => array(
'type' => 'input',
'size' => '30',
'max' => '30',
'eval' => 'required,trim',
)
),
'email' => array(
'exclude' => 0,
'label' => 'Email',
'config' => array(
'type' => 'input',
'size' => '30',
'max' => '50',
'eval' => 'trim',
)
),
),
'types' => array(
'0' => array('showitem' => 'firstname;;;;1-1-1, lastname, email')
),
'palettes' => array(
'1' => array('showitem' => '')
)
);

Finally ext_tables.php looks like that:

$TCA['Members'] = array(
'ctrl' => array(
'title' => 'MEMBERS',
'label' => 'lastname',
'tstamp' => 'NOW',
'crdate' => 'NOW',
'cruser_id' => '0',
'default_sortby' => 'ORDER BY lastname',
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'member.gif',
),
);

Records are shown but edit does not (yet) work. Furthermore, 'pid' cannot be mapped onto '0' (root).

Actions #2

Updated by Xavier Perseguers almost 15 years ago

Trick to be able to see DB values into the edit form is to use proper case in tca.php. For instance 'FirstName', 'LastName' instead of the default lowercase generated by kickstarter.

Problem is then to have a way to "unmap" invalid columns such as "tstamp" if they cannot be mapped to anything meaningful in the external database (and possibly map then back to some default value as I did "NOW" when SELECTing content from database.

Actions #3

Updated by Michael Miousse over 14 years ago

Hi xavier,

When you use this trick, are you able to use ts object content and ts object records as if the records would have real pids and uids?

Actions #4

Updated by Xavier Perseguers over 14 years ago

Hi Michael,

Did not try many things actually ;-)

But this was more to say that it already kinda exists and that we may hopefully build something on top of that instead of reinventing yet another special feature.

Actions #5

Updated by Alexander Opitz over 11 years ago

  • Status changed from Accepted to Needs Feedback
  • Target version deleted (0)
  • TYPO3 Version set to 4.1

As this report is very old, is the handling in newer TYPO3 CMS Versions (like 6.0/6.1) more like you expect it?

Actions #6

Updated by Alexander Opitz about 11 years ago

  • Status changed from Needs Feedback to Closed

No feedback for over 90 days.

Actions

Also available in: Atom PDF