Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More features for Foreign tables :D #13

Closed
webexmachina opened this issue Nov 30, 2017 · 5 comments
Closed

More features for Foreign tables :D #13

webexmachina opened this issue Nov 30, 2017 · 5 comments

Comments

@webexmachina
Copy link

Hi,

More a feature to add than an issue :)
For a project, I had to manage a big database, With the TableLookupWizard, it was easy to connect simple jointures.
But at one time, I had to use an associative table and I was stuck by the Joins array who didn't let me write more than the columns for the Join On structure.

For my problem, I find a dirty way to do it (but it's for me, with my rules soooo...), by overriding "prepareJoins" function and add a if statement who check if there is a "." in my jkey and fkey.
If it's the case, I don't use the prefixes but I let my code tell what to do. If not, your code does the job.

foreach ($this->arrJoins as $k => $v)
            {
                if(strpos($v['jkey'], ".") != false && strpos($v['fkey'], ".") != false)
                {
                    $this->arrQueryProcedure[] = sprintf("%s %s ON %s = %s", $v['type'], $k, $v['jkey'], $v['fkey']);
                }
                else
                {
                    $this->arrQueryProcedure[] = sprintf("%s %s ON %s.%s = %s.%s", $v['type'], $k, $k, $v['jkey'], $this->foreignTable, $v['fkey']);
                }
            }

Maybe you should add this way to use the Wizard, not in my way because it's crap, but with your vision :)

Best regards,
Julien, from Web ex Machina

@qzminski
Copy link
Member

I think we should just rewrite this extension one day to be more flexible. Then you would simple create your own widget extending this one and everything would be a piece of cake 😉 Hardcoding that particular case (or any other) is not the way to go imo.

@aschempp
Copy link
Member

aschempp commented Nov 30, 2017 via email

@webexmachina
Copy link
Author

As I say, it's not an issue, and I'm aware hardcoding is not a good way but when it's jut for me, I can be less careful ;)

@aschempp The new picker you said ?

@aschempp
Copy link
Member

aschempp commented Dec 1, 2017

Contao 4.4 provides a new picker that allows to pick any record from the Contao backend. The Contao backend already provides all the search functionality etc. Might be a replacement for a lot of cases, but certainly not all.

@webexmachina
Copy link
Author

Okay ! I'll try it :)
Thanks for your answers and see you later !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants