WordPress.org

Support

Support » Plugins and Hacks » WordPress MU Domain Mapping » [Plugin: WordPress MU Domain Mapping] Domain mapping tables not created

[Plugin: WordPress MU Domain Mapping] Domain mapping tables not created

  • I am finding this plugin is not creating the mapping tables in my installation. It appears to install okay, and the Settings->Domain Mapping setup page saves without any errors reported – but there are no tables created.

    Without those tables, attempting to create a new domain in the Settings->Domain screen simply throws you back to the blank form, again, with no errors or warnings generated (not even in the Apache log).

Viewing 11 replies - 1 through 11 (of 11 total)
  • In addition, the check for the sunrise script looks in this folder:

    WP_CONTENT_DIR . ‘/sunrise.php’

    If the sunrise script is not there, it tells you to put it in this folder:

    wp-content/sunrise.php

    That is misleading, as WP_CONTENT_DIR may be custom and so will not be “wp-content”.

    I would also add, looking through the code of this module, that the function names used are not consistently prefixed, and are just asking for name collisions with other modules.

    A fix for the lack of tables:

    The tables are created in the function dm_add_pages(), which does not get called in the WP3.1 network “superuser” administration pages. Instead the dm_network_pages() function is called to add the domain mapping menu items.

    My fix is to add the following line of code to the dm_network_pages() function:

    maybe_create_db();

    That then creates the tables as soon as the administrator displays the network admin pages, which is where they would have installed the plugin anyway.

    However – this does create a wasteful database check every time the admin page is displayed. It would be better to perform the check once in the Settings->Domain Mapping page.

    Plugin Author Ron Rennick

    @wpmuguru

    MultiSite Guru

    Sorry – not sure if you have logged/changed this and I just can’t see it, or you are hinting that I should be directing any bugs there 🙂

    AH, I didn’t spot the change.

    The comment about the functions include stuff like these:

    get_original_url
    remote_login_js
    get_dm_hash
    delete_blog_domain_mapping
    dm_site_admin
    maybe_create_db
    domain_mapping_warning

    Since functions are global, they should really all have a common prefix to avoid clashes with other modules. It is just to avoid any surprises when people install and use various plugins.

    In the future, I’m sure these functions will be wrapped up in a class for the plugin, and then they can be called whatever you like, but until WP catches up with a proper OO approach, we have to be a lot more careful when naming functions with global scope.

    I have already had clashes between identically-named functions introduced by themes and plugins, and it is not fun to debug.

    Plugin Author Ron Rennick

    @wpmuguru

    MultiSite Guru

    he comment about the functions include stuff like these:

    get_original_url
    remote_login_js
    get_dm_hash
    delete_blog_domain_mapping
    dm_site_admin
    maybe_create_db
    domain_mapping_warning

    Since functions are global, they should really all have a common prefix to avoid clashes with other modules. It is just to avoid any surprises when people install and use various plugins.

    If it’s really important to you to have this on a Sunday morning, perhaps you could provide a tested patch.

    Ah no, it’s not important for me, right now (Sunday Evening here). I’m mentioning this because this seems a rather important plugin in its area of functionality. Someone *could* accidentally break all their sites – which could run into hundreds or thousands – just by installing another plugin that happened to have the function get_original_url().

    My stuff is all working at the moment, so I don’t have an itch to scratch; but just making you aware of what may lie down the road.

    Hi, I’ve got this problem right now on my installation.

    Where can I find the dm_network_pages() function so that I may add the line maybe_create_db(); (what file and directory)?

    Plugin Author Ron Rennick

    @wpmuguru

    MultiSite Guru

    Download the development version. That’s been fixed in it.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: WordPress MU Domain Mapping] Domain mapping tables not created’ is closed to new replies.
Skip to toolbar