0

I cannot access views from the Structure Menu in Drupal 8 anymore. I accidentally changed the path of an RSS feed page in Views to refer to a menu link item and cannot access the Views menu anymore.

How does one fix this? I get an error that says "The website encountered an unexpected error. Please try again later when trying to access View Menu."

The report log says the following:

"InvalidArgumentException: The internal path component 'http://localhost/drupal/News-Press' is external. You are not allowed to specify an external URL together with internal:/. in Drupal\Core\Url::fromInternalUri() (line 409 of C:\xampp\htdocs\drupal\core\lib\Drupal\Core\Url.php)."

7
  • You may export the configuration (drush cex), search for taht view, change the path in the configuration files and then import the configuration (drush cim).
    – sanzante
    Feb 23, 2017 at 15:25
  • @sanzante how do I do that? Feb 23, 2017 at 15:30
  • Do you have drush installed? And, do you have access to other admin URLs like /admin/config/development/configuration?
    – sanzante
    Feb 23, 2017 at 15:42
  • @sanzante No I do not have drush installed but I do have access to every other admin URL except for Views. Feb 23, 2017 at 15:47
  • @sanzante I've replaced the line with the path and get the following error.... Could not extract the contents of the tar file. The error message is Invalid checksum for file "2-23-15-47/automated_cron.settings.ymlinterval: 10800 _core: default_config_hash: fUksROt4FfkAU9BV4hV2XvhTBSS2nTNrZS4U7S-tKrs PK/PK" : 48600 calculated, 0 expected Feb 23, 2017 at 16:09

1 Answer 1

0

You can export your configuration to files, then edit the file that holds wour faulty view, edit the URL, save it and import the configuiratin again.

To do this:

  1. Go to /admin/config/development/configuration/full/export and click 'Export'. Your browser should donwload tar.gz file.
  2. Uncompress the file to see all your site configuration splitted in multiple files.
  3. The file that holds your faulty view file should be views.view.NAME_OF_THE_VIEW. Edit it and look for a line with the view path. It should be:

    path: {wrong path}

  4. Change to the right path and save the file.

  5. Compress again all files to get again a tar.gz file. Is the same that you downloaded but with the file you have just updated.

  6. Go to /admin/config/development/configuration/full/import and upload your tar.gz file with the new configuration.

Drupal should update the configuration and change that view url.

Udpate

Unfortunately it seems there's a bug with views that can arise when editing file in Windows (an probably Mac): Importing tar file causes Archive_Tar error

I had the same problem and I found that I could not open the tar neither. So I tryed other exports. I found that when I don't export views settings, the tar is good. It's only when I put some specific views in the export that the tar does not work.

Second update As @user3531869 says, it's possible to update one single file of configuration to avoid the mentioned bug. To do this go to /admin/config/development/configuration/single/export and select the element you want to export (in this case select View as configuration type, Aggregator RSS Feed as configuration name), copy the the code that Drupal returns, edit to fix the path and the go to /admin/config/development/configuration/single/import, select View as configuration type, paste the edited code in the text area and clicj Import.

4
  • @user3531869 Make sure you edit the file with an editor that doesn't change lines form Unix to other system (Mac/Windows). It's only options I can guess. If not, you may install drush and do same process with dirsh (export with drush, edit, import with drush), but this is beyond this single answer.
    – sanzante
    Feb 23, 2017 at 16:18
  • Thanks for the help. I figured out how to get it working now. I went to Development>Configuration synchronization, clicked on Export tab, clicked on Single item sub-tab, Selected View as configuration type, Aggregator RSS Feed as configuration name, copied the code in the window underneath...clicked on the import tab above, clicked single item, selected view as configuration type, and pasted the code in the window below and modified the single line with the PATH and clicked import. Views now works Feb 23, 2017 at 17:23
  • Yes, I forgot to mention you could import a single file, sorry. I'm glad you fixed it.
    – sanzante
    Feb 23, 2017 at 17:34
  • Yeah no problem Feb 23, 2017 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.