Was trying for 2 hours to figure out what was wrong with this line of code

$join = new views_join('locales_source', 'term_data',   'name', 'source',   array(), 'LEFT');

Thanks to @dereine I figured it out.

Well, it would be really easy to just make a wrapper function around the pseudo constructor of views_join, support both PHP5 and PHP4

CommentFileSizeAuthor
views.handlers.inc_.patch1.06 KBrapsli

Comments

dawehner’s picture

Status: Active » Reviewed & tested by the community

Looks fine.

This can be especially commited to drupal-7--3 because we can rely on php5 there.

merlinofchaos’s picture

Status: Reviewed & tested by the community » Needs work

This wrapper works only for PHP5, leaving a disconnect for PHP4.

Perhaps the documentation is inadequate, but the constructor isn't intended to be used that way. In fact, I'm not sure that any existing implementation of views_join even uses construct() at this point (It's possible that I can't remember some, tho) in favor of just setting the variables individually via a definition.

rapsli’s picture

well, I was more thinking for modules/plugins that actually do use PHP5. The PHP 4 guys could still use the class the same way as today, the PHP 5 kids could though use it the easy way.

tim.plunkett’s picture

Status: Needs work » Closed (works as designed)

Nowhere in any of the three Views branches is `new views_join` called with any parameters.
Checked with grep -nr "new views_join([^)]" *